New wiki: Solaris-Linux command comparison

Ever have trouble remembering command syntax in Solaris or Linux? Like the precise syntax for how to list the 10 largest files, create an ISO image, or manage printers? Can you remember the syntax in Linux but need the equivalent in Solaris? Or vice versa?
A new wiki -- "OTN Solaris-Linux Command Comparo" -- lists common sysadmin tasks for both Oracle Solaris 10 & Oracle Enterprise Linux 5. You can access the wiki at:
[https://wikis.sun.com/display/OTNTaskFinder/CommandComparo+Home|https://wikis.sun.com/display/OTNTaskFinder/CommandComparo+Home]
Note that you need to register for Oracle Wiki site access first at [http://wikis.sun.com/display/Help/Registering|http://wikis.sun.com/display/Help/Registering] . Please give us some feedback on the wiki and add the commands you most often forget...

Yes, we wanted to go a little more in-depth and list actual syntax, but the idea is the same. You'll note that "A Sysadmin's Unixersal Translator (ROSETTA STONE)" is listed as a Reference in the .left-section panel of the wiki.

Similar Messages

  • New to Solaris (unix) - basic questions (please)

    Hello!
    I am completely new in Solaris World, and in fact in Linux too. All I can do (may be) is to walk throught dir tree. I have one big question and many many small ones. I've just installed Solaris 10 (writing this there), I am very happy and I don't know what to do. I hope you can give me some advice. Well, the big question is where to get information about how to do basic tasks I've been doing in windows?
    The smaller questions (problems) is:
    1) When I boot solaris it actually goes to console, and no window system (GNOME, CDE) appears. I've already been lucky for 2 times and I managed to launch windows by typing 'gnome-terminal', but it ofter respond with something and no window system lauched. Can I do so, that window system launched automatically?
    2) I have primary partition on my hard drive with FAT 32 to share files with WindowsXP. Where can I see these files in Solaris (may be I should mount, how?)
    3) How can I see files on my USB flash (how to mount)
    4) Do I have to install drivers for my monitor(video card) in Solaris?
    5) When I type 'man' its ok, but 'man ls' respond 'No manual entry for ls' (and all other commands. How to fix it?
    6) Where I should store my files (doc, music etc. ). In windows its typically on different partitions (folders)
    Thank you, and hoping for help.

    Well you've a long road ahead. But heres a start:
    Answer to Question 1) /usr/dt/bin/dtconfig -eQuestion 2) If there are FAT32 driver in Solaris 10 (There weren't to my knowledge in Sol9 or earlier) you would need to mount them.
    'man mount'
    Question 3) would be similar to the answer to question 2, although you may be able to configure autofs for it 'man autofs'
    Question 4) Not necessarily, but to get full functionality of your video card, yes - see manufacturers website
    Question 5) Your MANPATH environment variable is bad OR you did not install them .... try 'pkginfo SUNWman' if it returns anything but not found try 'MANPATH=/usr/man:/usr/share/man:/usr/sfw/man ;export MANPATH' You can add additionaly directories pointing to manpage install locations by adding a colon followed by the directory.. first off hit 'man man'
    Question 6) Gnome will help once you get it going (see answer 1). Otherwise store it however you like, just don't let the root partition get full or you'll likely crash it.

  • New to Solaris administration - Need some help with some issues

    Hello all,
    I am a new to Solaris administration and need some assistance with a few things. I was going to make separate posts but decided it would be easy to keep track of in one. I really do not know much about the OS but I do have a little Linux background so that might help me out. I am going to number my problems to keep them sorted, so here we go.
    The machine:
    Sunfire V880
    4x 73GB HDs
    PCI dual fiber channel host adapter
    Attached RAID array:
    Sun StorEdge T3 Array with 9x 73GB HDs
    Sun DDS4 Tape Drive in a Unipack
    OS: Solaris 5.10
    Updates: Updated everything except 2 patches (Updating is a real pain isn't it? At least it seems that way to me.)
    1. So I might as well start with the update issues! These 2 updates will not install:
    -PostgreSQL 8.2 source code, (137004-02)
    Utility used to install the update failed with exit code {0}.
    -Patch for mediaLib in solaris, (121620-03)
    Install of update failed. Utility used to install the update is not able to save files. Utility used to install the update failed with exit code 4.
    No idea why the PostgreSQL update is not working, but the medialib patch seems to not have enough hard drive space.
    2. Where are all the drives? I don't know how to find the RAID box or the other 3 internal hard drives. When I installed the OS, I think I installed it on only one hard drive and that might be part of the reason why the medialibe update above says that I don't have enough space.
    3. I probably need more space for the OS and updates, is there a way to "add" space onto the hard drive that currently is running the OS?
    3. Once I see the other hard drives I wish to combine them to make a RAID 0 and RAID 5 array, how do I go about doing that?
    4. How can I find/see the tape drive?
    5. Does my swap space really need to be 64GB? I know the book I have read suggests it, but I only made it 5GB because it didn't seem to make sense to make it 64GB.
    Thank you in advance for the help. I know these are a lot of questions to ask but please go easy on me :)
    rjbanker
    Edited by: rjbanker on Mar 7, 2008 8:21 AM

    SolarisSAinPA*
    1.
    -PostgreSQL 8.2 source code, (137004-02)
    Utility used to install the update failed with exit code {0}.
    Exit code 0 means there were no errors. When you run showrev -p 137004-02, does your system show that the patch is installed? You can check the log for a particular patch add attempt in /var/sadm/patch/+patch_num_rev+1- A bunch of stuff shows up, here is a portion (I am not entirely sure what it means, there must be a least a page of stuff like this):
    Patch: 121081-08 Obsoletes: Requires: 121453-02 Incompatibles: Packages: SUNWc cccrr, SUNWccccr, SUNWccfw, SUNWccsign, SUNWcctpx, SUNWccinv, SUNWccccfg, SUNWcc fwctrl
    Patch: 122231-01 Obsoletes: Requires: 121453-02 Incompatibles: Packages: SUNWc ctpx
    Patch: 120932-01 Obsoletes: Requires: Incompatibles: Packages: SUNWcctpx
    Patch: 123123-02 Obsoletes: Requires: Incompatibles: Packages: SUNWccinv
    Patch: 121118-12 Obsoletes: Requires: 121453-02 Incompatibles: Packages: SUNWc smauth, SUNWppror, SUNWpprou, SUNWupdatemgru, SUNWupdatemgrr, SUNWppro-plugin-su nos-base
    2.
    Where are all the drives? I don't know how to find the RAID box or the other 3 internal hard drives. When I >installed the OS, I think I installed it on only one hard drive and that might be part of the reason why the >medialibe update above says that I don't have enough space.
    When you run format command, how many drives are listed? Identify your root drive (compare with output of df command you ran earlier) Please post here.2. Output of df-hk, looks like I ran out of room. Should I just go ahead and reinstall the OS?
    Filesystem size used avail capacity Mounted on
    /dev/dsk/c1t0d0s0 5.9G 5.4G 378M 94% /
    /devices 0K 0K 0K 0% /devices
    ctfs 0K 0K 0K 0% /system/contract
    proc 0K 0K 0K 0% /proc
    mnttab 0K 0K 0K 0% /etc/mnttab
    swap 42G 1.3M 42G 1% /etc/svc/volatile
    objfs 0K 0K 0K 0% /system/object
    /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
    5.9G 5.4G 378M 94% /platform/sun4u-us3/lib/libc_psr.so.1
    /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
    5.9G 5.4G 378M 94% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
    fd 0K 0K 0K 0% /dev/fd
    swap 42G 1.1M 42G 1% /tmp
    swap 42G 32K 42G 1% /var/run
    /dev/dsk/c1t0d0s7 46G 47M 46G 1% /export/home
    3. So I guess the general consensus is to reinstall the OS, is that correct?
    4. There is nothing in \dev\rmt, and unfortunately I don't have a tape to test it with!
    5. I guess 5GB will be ok for what we do.
    Alan.pae*
    1. I think the above text might explain why it failed, although I don't know how to correct it.
    2. Output of format:
    # mount
    / on /dev/dsk/c1t0d0s0 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1d80008 on Mon Mar 10 10:56:51 2008
    /devices on /devices read/write/setuid/devices/dev=4dc0000 on Mon Mar 10 10:56:19 2008
    /system/contract on ctfs read/write/setuid/devices/dev=4e00001 on Mon Mar 10 10:56:19 2008
    /proc on proc read/write/setuid/devices/dev=4e40000 on Mon Mar 10 10:56:19 2008
    /etc/mnttab on mnttab read/write/setuid/devices/dev=4e80001 on Mon Mar 10 10:56:19 2008
    /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4ec0001 on Mon Mar 10 10:56:19 2008
    /system/object on objfs read/write/setuid/devices/dev=4f00001 on Mon Mar 10 10:56:19 2008
    /platform/sun4u-us3/lib/libc_psr.so.1 on /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 read/write/setuid/devices/dev=1d80008 on Mon Mar 10 10:56:50 2008
    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1 on /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 read/write/setuid/devices/dev=1d80008 on Mon Mar 10 10:56:50 2008
    /dev/fd on fd read/write/setuid/devices/dev=50c0001 on Mon Mar 10 10:56:51 2008
    /tmp on swap read/write/setuid/devices/xattr/dev=4ec0002 on Mon Mar 10 10:56:52 2008
    /var/run on swap read/write/setuid/devices/xattr/dev=4ec0003 on Mon Mar 10 10:56:52 2008
    /export/home on /dev/dsk/c1t0d0s7 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1d8000f on Mon Mar 10 10:56:57 2008
    3. Judging by the above text I will be doing a reinstall huh?
    4. Actually I am not familiar with tape backups let alone solaris backup apps! Any suggestions? (Preferably free, have to cut down on costs.)
    5. No comment
    Thanks for the help, hope to hear from you again!
    rjbanker

  • Problem in executing Linux command from Java Programme.

    hi everybody,
    can anybody help me to solve one problem i have.
    i want to capture the output of linux command "grep" in my java programme.but it is not working properly .(maybe this sub-process doesn't have permission to read files)
    here is my code and corresponding outputs.
    import java.io.*;
    public class BSearch
    public static void main(String kj[])
    try
    Runtime rt=Runtime.getRuntime();
    String command="grep \"hello\" -r /usr/MyDir ";               
    Process rtProc=rt.exec(command);          
    InputStream is=rtProc.getInputStream();
    BufferedReader br =new BufferedReader(new InputStreamReader(is));     
    String line =null;
    while((line=br.readLine()) != null)
    System.out.println(br.readLine());
    br.close();
    catch(Exception e)
    System.err.println("Error in command "+e);               
    it finds "hello" pattern only in BSearch.class file although if i fire this command on LINUX prompt it
    shows all the files in /usr/MyDir which contain "hello" pattern.
    java programme output :
    Binary file /usr/MyDir/BSearch.class matches.
    linux command output :
    /usr/MyDir/one.txt: hello sdfs
    Binary file /usr/MyDir/BSearch.class matches.
    /usr/MyDir/two.txt: kjsdf hello sdfsdf
    will anybody help me solve this problem.

    It may be a Problem of Catching the Echoes back from the Processes...I have a Program which Captures the Echoes..see if it works
    import java.beans.PropertyChangeEvent;import java.beans.PropertyChangeListener;import java.beans.PropertyChangeSupport;import java.lang.ref.WeakReference;/** * Implements a proxy property change listener using a weak reference to avoid memory locking that would occur if it * was a strong reference. To understand this, we hve to understand that the property change listeners themselves are * hilding onto panels and other objects with strong java references. If the panel goes away while we are viewing an * object, we have a circular emory hold situation where the panel cant be collected because it has ahold of the * property and the property cannot because it has ahold of the pane. If we use weak references instead, then the hard * link between the listener and the producer is softened to almost nothing. */public class WeakPropertyChangeListener implements PropertyChangeListener {  /**   * A poperty change support object is included here so that the listener can remove   * himself from the listeners if the reference internally goes to null.   */  private PropertyChangeSupport pcs = null;  /** Holds the weak reference to the real listener. */  private WeakReference weakRef = null;  /**   * Constructs a new Proxy object for the given support and listener.   * @param pcs The property change support that this object will be using.   * @param pcl The real listener.   */  public WeakPropertyChangeListener(PropertyChangeSupport pcs, PropertyChangeListener pcl) {    if (pcs == null) throw new NullPointerException("pcs");    if (pcl == null) throw new NullPointerException("pcl");    this.pcs = pcs;    weakRef = new WeakReference(pcl);  } /** @see <{PropertyChangeListener}> */ public void propertyChange(PropertyChangeEvent changeEvent) {    Object referrant = weakRef.get();    if (referrant == null) {      pcs.removePropertyChangeListener(this);    } else {      ((PropertyChangeListener)referrant).propertyChange(changeEvent);    } } /** Returns true for comparison to referrant or this. */ public boolean equals(Object obj) {    if (obj instanceof WeakPropertyChangeListener) return super.equals(obj);    else if (obj != null)return obj.equals(weakRef.get());    else return false;  }}// snipet public void addPropertyChangeListener(PropertyChangeListener listener) {    this.propertyChangeSupport.addPropertyChangeListener(      new WeakPropertyChangeListener(this.propertyChangeSupport, listener));  } public void removePropertyChangeListener(PropertyChangeListener listener) {    this.propertyChangeSupport.removePropertyChangeListener(listener);  }

  • New to Solaris, Some Samba and NTFS issues.

    Hi Im new to solaris and trying out ZFS which has been great.
    Im haivng some trouble that I cant find up to date info on so here goes:
    First how do you mount an NTFS volume in Solaris 11 Express?
    I need to access the data on an NTFS drive to populate my new ZFS tank.
    Secondly, I have read only access on my samba shares from windows machines but my smb.conf looks right. a copy of my smb.conf will follow
    Any suggestions would be appreciated.
    # This is the main Samba configuration file. You should read the
    # smb.conf(5) manual page in order to understand the options listed
    # here. Samba has a huge number of configurable options (perhaps too
    # many!) most of which are not shown in this example
    # For a step to step guide on installing, configuring and using samba,
    # read the Samba-HOWTO-Collection. This may be obtained from:
    # http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
    # Many working examples of smb.conf files can be found in the
    # Samba-Guide which is generated daily and can be downloaded from:
    # http://www.samba.org/samba/docs/Samba-Guide.pdf
    # Any line which starts with a ; (semi-colon) or a # (hash)
    # is a comment and is ignored. In this example we will use a #
    # for commentry and a ; for parts of the config file that you
    # may wish to enable
    # NOTE: Whenever you modify this file you should run the command "testparm"
    # to check that you have not made any basic syntactic errors.
    #======================= Global Settings =====================================
    [global]
    # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
    workgroup = WORKGROUP
    # server string is the equivalent of the NT Description field
    server string = Samba Server
    # Security mode. Defines in which mode Samba will operate. Possible
    # values are share, user, server, domain and ads. Most people will want
    # user level security. See the Samba-HOWTO-Collection for details.
    security = share
    # This option is important for security. It allows you to restrict
    # connections to machines which are on your local network. The
    # following example restricts access to two C class networks and
    # the "loopback" interface. For more examples of the syntax see
    # the smb.conf man page
    ; hosts allow = 192.168.1. 192.168.2. 127.
    # If you want to automatically load your printer list rather
    # than setting them up individually then you'll need this
    load printers = yes
    # you may wish to override the location of the printcap file
    ; printcap name = /etc/printcap
    # on SystemV system setting printcap name to lpstat should allow
    # you to automatically obtain a printer list from the SystemV spool
    # system
    ; printcap name = lpstat
    # It should not be necessary to specify the print system type unless
    # it is non-standard. Currently supported print systems include:
    # bsd, cups, sysv, plp, lprng, aix, hpux, qnx
    ; printing = cups
    # Uncomment this if you want a guest account, you must add this to /etc/passwd
    # otherwise the user "nobody" is used
    ; guest account = pcguest
    # this tells Samba to use a separate log file for each machine
    # that connects
    log file = /var/samba/log/log.%m
    # Put a capping on the size of the log files (in Kb).
    max log size = 50
    # Use password server option only with security = server
    # The argument list may include:
    # password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
    # or to auto-locate the domain controller/s
    # password server = *
    ; password server = <NT-Server-Name>
    # Use the realm option only with security = ads
    # Specifies the Active Directory realm the host is part of
    ; realm = MY_REALM
    # Backend to store user information in. New installations should
    # use either tdbsam or ldapsam. smbpasswd is available for backwards
    # compatibility. tdbsam requires no further configuration.
    passdb backend = smbpasswd
    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting.
    # Note: Consider carefully the location in the configuration file of
    # this line. The included file is read at that point.
    ; include = /usr/sfw/lib/smb.conf.%m
    # Configure Samba to use multiple interfaces
    # If you have multiple network interfaces then you must list them
    # here. See the man page for details.
    ; interfaces = 192.168.12.2/24 192.168.13.2/24
    # Browser Control Options:
    # set local master to no if you don't want Samba to become a master
    # browser on your network. Otherwise the normal election rules apply
    ; local master = no
    # OS Level determines the precedence of this server in master browser
    # elections. The default value should be reasonable
    ; os level = 33
    # Domain Master specifies Samba to be the Domain Master Browser. This
    # allows Samba to collate browse lists between subnets. Don't use this
    # if you already have a Windows NT domain controller doing this job
    ; domain master = yes
    # Preferred Master causes Samba to force a local browser election on startup
    # and gives it a slightly higher chance of winning the election
    ; preferred master = yes
    # Enable this if you want Samba to be a domain logon server for
    # Windows95 workstations.
    ; domain logons = yes
    # if you enable domain logons then you may want a per-machine or
    # per user logon script
    # run a specific logon batch file per workstation (machine)
    ; logon script = %m.bat
    # run a specific logon batch file per username
    ; logon script = %U.bat
    # Where to store roving profiles (only for Win95 and WinNT)
    # %L substitutes for this servers netbios name, %U is username
    # You must uncomment the [Profiles] share below
    ; logon path = \\%L\Profiles\%U
    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
    ; wins support = yes
    # WINS Server - Tells the NMBD components of Samba to be a WINS Client
    #     Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    ; wins server = w.x.y.z
    # WINS Proxy - Tells Samba to answer name resolution queries on
    # behalf of a non WINS capable client, for this to work there must be
    # at least one     WINS Server on the network. The default is NO.
    ; wins proxy = yes
    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
    # via DNS nslookups. The default is NO.
    dns proxy = no
    # These scripts are used on a domain controller or stand-alone
    # machine to add or delete corresponding unix accounts
    ; add user script = /usr/sbin/useradd %u
    ; add group script = /usr/sbin/groupadd %g
    ; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
    ; delete user script = /usr/sbin/userdel %u
    ; delete user from group script = /usr/sbin/deluser %u %g
    ; delete group script = /usr/sbin/groupdel %g
    #============================ Share Definitions ==============================
    [homes]
    comment = Home Directories
    browseable = no
    writable = yes
    # Un-comment the following and create the netlogon directory for Domain Logons
    ; [netlogon]
    ; comment = Network Logon Service
    ; path = /usr/sfw/lib/netlogon
    ; guest ok = yes
    ; writable = no
    ; share modes = no
    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
    ;[Profiles]
    ; path = /usr/local/samba/profiles
    ; browseable = no
    ; guest ok = yes
    # NOTE: If you have a BSD-style print system there is no need to
    # specifically define each individual printer
    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    # Set public = yes to allow user 'guest account' to print
    guest ok = no
    writable = no
    printable = yes
    # This one is useful for people to share files
    ;[tmp]
    ; comment = Temporary file space
    ; path = /tmp
    ; read only = no
    ; public = yes
    # A publicly accessible directory, but read only, except for people in
    # the "staff" group
    ;[public]
    ; comment = Public Stuff
    ; path = /home/samba
    ; public = yes
    ; writable = no
    ; printable = no
    ; write list = @staff
    # Other examples.
    # A private printer, usable only by fred. Spool data will be placed in fred's
    # home directory. Note that fred must have write access to the spool directory,
    # wherever it is.
    ;[fredsprn]
    ; comment = Fred's Printer
    ; valid users = fred
    ; path = /homes/fred
    ; printer = freds_printer
    ; public = no
    ; writable = no
    ; printable = yes
    # A private directory, usable only by fred. Note that fred requires write
    # access to the directory.
    ;[fredsdir]
    ; comment = Fred's Service
    ; path = /usr/somewhere/private
    ; valid users = fred
    ; public = no
    ; writable = yes
    ; printable = no
    # a service which has a different directory for each machine that connects
    # this allows you to tailor configurations to incoming machines. You could
    # also use the %U option to tailor it by user name.
    # The %m gets replaced with the machine name that is connecting.
    ;[pchome]
    ; comment = PC Directories
    ; path = /usr/pc/%m
    ; public = no
    ; writable = yes
    # A publicly accessible directory, read/write to all users. Note that all files
    # created in the directory by users will be owned by the default user, so
    # any user with access can delete any other user's files. Obviously this
    # directory must be writable by the default user. Another user could of course
    # be specified, in which case all files would be owned by that user instead.
    ;[public]
    ; path = /usr/somewhere/else/public
    ; public = yes
    ; only guest = yes
    ; writable = yes
    ; printable = no
    # The following two entries demonstrate how to share a directory so that two
    # users can place files there that will be owned by the specific users. In this
    # setup, the directory should be writable by both users and should have the
    # sticky bit set on it to prevent abuse. Obviously this could be extended to
    # as many users as required.
    ;[myshare]
    ; comment = Mary's and Fred's stuff
    ; path = /usr/somewhere/shared
    ; valid users = mary fred
    ; public = no
    ; writable = yes
    ; printable = no
    ; create mask = 0765
    [Series]
    comment = TV Series
    path = /home/Kirby/Series
    public = yes
    only guest = yes
    writable = yes
    printable = no

    875739 wrote:
    Hi Im new to solaris and trying out ZFS which has been great.
    Im haivng some trouble that I cant find up to date info on so here goes:
    First how do you mount an NTFS volume in Solaris 11 Express?
    I need to access the data on an NTFS drive to populate my new ZFS tank.I never had a need for it but I think you'll have to compile fuse ntfs-3g manually.
    http://web.archiveorange.com/archive/v/u46DbWSGcIzl7pexf4hQ
    >
    Secondly, I have read only access on my samba shares from windows machines but my smb.conf looks right. a copy of my smb.conf will follow
    Any suggestions would be appreciated.You don't need to use Samba in Solaris 11 Express.
    http://download.oracle.com/docs/cd/E19963-01/html/821-1448/gaynd.html#gayne

  • New to solaris---is update manager working correctly?

    well as my subject says I am new to solaris having put it on an pc bout a week ago. as I am using the "free" verson (not open solaris) I knew I would not be entitled to certain goodies but seem to have run into an issue getting the updates I (presumably) am entitled to. simply put I open up the solaris application "update manager" which is on my desktop saying "updates available". now upon initially launching the app I specified that I was using the free version (well it let me register without a code so I assume sun knows my status), and then selected the option to put a check mark next to all available updates. well after waiting like a full day with it showing that is was still in the process up updating I eventually aborted the process. I then tried installing a couple of the updates and though it took a while it worked. so I selected 3 of 4 more and again the update manager showed that I was updating but nothing was happening (to my knowledge). after several hours I aborted the app again. so what am I doing wrong. first off I am assuming that what sun presents to me is what is actually available to me using the free unregistered version of solaris. why then would updates fail? btw I know some linux (not an expert) and I figured that behind the scenes update manager was checking for dependencies and installing what I needed from sun repos. but of course I could be way off bass here. so what gives? thanks much in advance.

    first off I am assuming that what sun presents to me is what is actually available to me using the free unregistered version of solaris.No. Update Manager will show you everything but will only allow you to install basically security and a small subset of other patches.
    When you ran through the Solaris registration GUI you had a chance to enter a support contract #. If you chose not to enter one or if you want to use it without registering then you only get access to a few of the patches.
    alan

  • How to call linux command ?

    hi all,
    I wanna make java application which display the ouput of linux command (eg. ps -ax output in JTextArea).
    The problem is how to call "ps,kill,etc" ?

    JTextArea txtOutput = new JTextArea();
    String cmd = "ps -a";
    Process proc = Runtime.getRuntime().exec(cmd);
    BufferedReader buf = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    String out;
    while ((out = buf.readLine()) != null){
    System.out.println("Output: "+out);
    txtOutput.append(out+"\n");
    }

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Execute linux command from java

    I wanna execute linux command from java, bu the output has error:
    Return code = 1
    top: failed tty get
    The code as:
    import java.io.*;
    public class Execute {
         public static void main(String[] args) {
              try {
                   final Process process = Runtime.getRuntime().exec("top");
                   new Thread() {
                        public void run() {
                             try {
                                  InputStream is = process.getInputStream();
                                  byte[] buffer = new byte[1024];
                                  for (int count = 0; (count = is.read(buffer)) >= 0;) {
                                       System.out.write(buffer, 0, count);
                             } catch (Exception e) {
                                  e.printStackTrace();
                   }.start();
                   new Thread() {
                        public void run() {
                             try {
                                  InputStream is = process.getErrorStream();
                                  byte[] buffer = new byte[1024];
                                  for (int count = 0; (count = is.read(buffer)) >= 0;) {
                                       System.err.write(buffer, 0, count);
                             } catch (Exception e) {
                                  e.printStackTrace();
                   }.start();
                   int returnCode = process.waitFor();
                   System.out.println("Return code = " + returnCode);
              } catch (Exception e) {
                   e.printStackTrace();
    }Help please.

    Your code is probably good to run a program, that does not use terminal capabilities.
    Program "top" is a little bit more complicated - you have to run it with a real terminal.
    Try to run "xterm -e top". You can find an example how to run an external program
    from java code in cnd/gdb module on http://cnd.netbeans.org
    For example, take a look at openExternalProgramIOWindow() method on this page:
    http://cnd.netbeans.org/source/browse/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/proxy/Attic/GdbProxyCL.java?rev=1.1.2.6.2.5&only_with_tag=release551_fixes&view=markup
    It runs a command with external terminal.
    Thanks,
    Nik

  • Unable to execute Linux command from Java

    Hi,
    I am currently working on a code wherein i need to execute Linux command from Java. Below are some of the query i have.
    1) Is there any efficient method of running OS commands from Java, rather than using Runtime and Process method.
    2) Below is details of my code which fails in execution
    **-- Java Version**
    java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Server VM (build 1.6.0-b09, mixed mode)
    -- Program Code ----
    Where <path> = Path i put myself
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
         * @param args
         public static void main(String[] args) {
              GetInode test = new GetInode();
              test.getInode();
         public void getInode(){                    
              String command = "/usr/bin/stat -Lt <path>;
              System.out.println(command);
              Process process;
              Runtime rt;     
              try{
              rt = Runtime.getRuntime();               
              process = rt.exec(command);
              InputStreamReader isr = new InputStreamReader(process.getErrorStream());
              BufferedReader bre = new BufferedReader(isr);
              BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream());
              System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
              process.destroy();          
              }catch (Exception ex){
                   System.out.println("Error :- " + ex.getMessage());
    ------Output -------------
    /usr/bin/stat -Lt "<path>"
    /usr/bin/stat: cannot stat `"<path>"': No such file or directory
    Error :- null
    Can any one help me what is wrong and why i am unable to run the Linux command from Java.

    For clarity purpose............i m submitting actual code here
    --- Code ---
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
    * @param args
    public static void main(String[] args) {
    GetInode test = new GetInode();
    test.getInode();
    public void getInode(){               
    String command = "/usr/bin/stat -Lt \"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt\"";
    System.out.println(command);
    Process process;
    Runtime rt;
    try{
    rt = Runtime.getRuntime();
    process = rt.exec(command);
    InputStreamReader isr = new InputStreamReader(process.getErrorStream());
    BufferedReader bre = new BufferedReader(isr);
    BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
    System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
    process.destroy();
    }catch (Exception ex){
    System.out.println("Error :- " + ex.getMessage());
    --- Output ---
    [ratz]s0898671: java GetInode
    /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /usr/bin/stat: cannot stat `"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"': No such file or directory
    Error :- null
    -- Linux Terminal --
    If i copy the first line from the output and execute on Linux terminal her is the output that i get
    [ratz]s0898671: /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt 12003 24 81a4 453166 10000 1c 360466554 2 0 1 1246638450 1246638450 1246638450 4096
    Can you just assist me where am i really making mistake.......i was wondering if the command that i pass from Java....can be executed on Linux terminal why is it faling to run from java.........and when i print the Error Stream for process output........it show cannot Stat.......

  • Problem in running Linux command using JavaRuntine

    All,
    When I ran a Linux command in Java Program It does not give a correct output instead it returns null string.
    When I ran the Qsub command( as given in the below program) in Java program I suppose to get Unable to run job: unknown resource "mechhpc1".Exiting. as an output. But it returns null string. It works fine in linux terminal.
    Can you please anyone help me to fix this issue?
    Regards,
    Thamizhannal P
    Source code:
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    public class QSubCmdTest {
         static String Qsub = "sudo -u tce qsub -S /bin/bash ansys_p3 "
                   + "-pe Parallel 3 -l h_rt=3:4:4,ansys=0.333,mechhpc1=0.333 "               
                   + "-a 0804081247.15 /home/tce/c1p4/AnsysParallel";
    /* The aboove command output in terminal (linux machine)
    Unable to run job: unknown resource "mechhpc1".Exiting. */
         static String QSUBcommandOutput = "";
         public static void main(String[] args) {
              System.out.println("Job Submission testing");
              try {
                   Process processExecGenericJobScript = Runtime.getRuntime().exec( new String[]{"/bin/bash","-c",Qsub});
                   //QSUB Command output Reader
                   BufferedReader QSUBcommandOutputReader = new BufferedReader(
                             new InputStreamReader(processExecGenericJobScript
                                       .getInputStream()));
                   System.out.println("Reader "+QSUBcommandOutputReader.readLine());
                   //QSUB command output string
                   String QSUBCommandOutputString = "";
                   while ((QSUBCommandOutputString = QSUBcommandOutputReader
                             .readLine()) != null) {
                        QSUBcommandOutput += QSUBCommandOutputString;
                        QSUBcommandOutput += "\n";
                   System.out.println("QSUBcommandOutput:" + QSUBcommandOutput);
              } catch (Exception exp) {
                   exp.getMessage();
    }

    I would expect error messages to be output on stderr not stdout and you only read stdout. You should read, digest and implement the recommendations in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .

  • LINUX commands for navigating Oracle_Database configuration assistant?

    I'm very new to the linux scene, but I'm very familiar with the NT Oracle side. I'm having trouble navigating around LInux looking for the commands to run Oracle. If anyone has any pointers on particulars I'd appreciate it. But to start, can someone tell me how to get the Database Configuration Assistant up in Linux on Oracle9i? I just completed installation of Oracle9i successfully(I think), but it hung on the Network configuration and Database Creation. I've found the Listener/TNS files, but I can't find the Configuration Assistant.
    Thanks to any who can help,
    Tom

    it should be in $ORACLE_HOME/bin/dbca (/opt/oracle/product/9.0.1/bin/dbca)
    I am doing this from memory so it might be off.

  • Sysql - use SQL queries against output of linux commands

    Hello!
    Many linux commands have table-like output. Sometimes it is better to analyze such output as a real table in relational database. I have published prototype of utility that parses output of one or several linux commands, saves it in database and allows to make SQL queries to that data. Program is written on python and uses sqlite database engine.
    sysql at AUR
    sysql at Github
    Here is why I wrote it:
    * No need to remember command syntax to format command output - just select necessary fields in SQL query
    * No need to know sed, awk, head, join and other linux commands to manipulate with output - it's all SQLite
    * Table data is stored with meaningful column name and type (int, text, float, datetime etc)
    * All power of SQL can be used to query output (JOIN, WHERE, GROUP BY etc.)
    * To support new command, output parser must be developed only once and then can be shared with community to make life easier
    * All supported commands are kept in one place as set of python files, so it is easy to find out how to customize existing parsers or create new ones
    This is my first community contribution, so kindly ask everyone to share your opinions and advices on what can be done better. Thank you!
    Examples:
    Display help and list of available commands:
    sysql
    Display output of ps command:
    sysql ps
    Query output of lsblk command:
    sysql -q "SELECT device,uuid,filesystem FROM lsblk" lsblk
    Query output of several commands:
    sysql -q "SELECT ps.pid, ps.command, ps.elapsed_time, lsof.name FROM ps JOIN lsof ON ps.pid = lsof.pid WHERE name LIKE '%LISTEN%'" ps -e --- lsof -Pni4

    I am not sure, if I will ever use it, but I do think, this is an _amazing_ idea!
    You may consider something like a global repository for output parsers accessable directly via sysql.
    Last edited by myname (2013-11-24 09:16:59)

  • Need to execute Linux Commands in JSP

    Hi I am Srinivas,
    I am new to this forum,
    {color:#ff0000}I want to execute Linux Commands(which is remotely connected through putty) in a JSP Page.{color}
    {color:#0000ff}My requirement is to display df -h output on a JSP page.{color}
    This is because we will monitor disk space at regular intervals.
    Can anyone help me in this regard.
    Thanks & Regards
    Srinivas V.
    Edited by: Srini-XIUS on Mar 24, 2008 2:06 AM

    I think you might need the java 'robot' class.
    However, a JSP page displayed on a browser is running in a secure enviornment that will probably not let you access the computer its running on. Instead, create a serlvet back on the server that runs the robot class. The servlet will send the data to the jsp page for display. The jsp page can send commands to the servlet which will execute it via its robot class.

  • Executing sudo linux commands through a JSP page.

    Hi,
    I need to execute some superuser commands through a JSP page under Linux.
    I added users apache and tomcat to the /etc/sudoers file with no password prompting.
    My JSP page works fine with any usual linux command, but when I call a “sudo cmd” I have a message (when reading the ErrorStream instead of the InputStream) that “sudo can’t be executed because it needs a tty” even when I call the shell before the sudo command.
    Here is a piece of my code (very basic):
    String cmd="linux_cmd";
    Process proc = Runtime.getRuntime().exec(cmd);
    InputStream stdin = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stdin);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null)
    out.println(line);
    Is there any way I can make sudo calls from a JSP page ?
    I know that making root calls from a web application is a bad thing, but for now security is not my concern.
    Thank you for any tips.

    JavaFan2 wrote:
    In fact, I help supervising a student project who is supposed to write an admin application to offert graphical interfaces for some security and system tools under Linux (like fdisk, iptables etc) using J2EE, ... something like Webmin.
    As I said, I know that is has a huge security risk but this app has the only purpose of learning J2EE, no security issues are treated.If you want to say "I will leave my office door open because there's no security risk in doing that" then that's a valid statement. But what you are trying to do here isn't the equivalent of leaving your office door open. It's the equivalent of finding a master key for all the offices in the world. And as such it is in fact a serious security risk which should not be circumvented.
    And no, it's no good saying "But I'm only going to use this all-powerful master key to open my own office door". If you get the key then anybody else can get the key too.

Maybe you are looking for

  • Toolbar in Interaction Center (CRM 2007)

    Hi, I have added few buttons in the toolbar of Interaction Center of CRM 2007. I want now to catch the event, when the user click on those buttons. If I understand it correctly I have to add the new event in the function wsb_handler. How can i find t

  • Having a PDF document close immediately after priniting

    Hi guys, I need to know if it's possible to have a pdf document close immediately when print is selected..... In addition to this, is there something that can restrict the number of copies to 1. This is for a downloadable voucher and i don't want peo

  • Specifying the current database in MSSQL

    How do you change the "Current" database using the JDBC:ODBC driver ? I know you could refer to a table in MSSQL by using database.owner.table but I was wondering if you could specify the current database in some manner ? Can you do it through the co

  • Bank account number against Document number

    Hi Experts, I have a scenario where i have Document no. of clearing doc. i.e. AUGBL and based on that i need to know bank account number i.e. BANKN. Can anybody suggest the sap tables from where i can get it ? Thanks, Akash

  • Illustrator CC errors reopening docs with pie charts

    I created some sample pie charts for a client - had no problems with the document while it was open. It saved fine, I even saved it as an EPS. However, when I try to reopen the document, it gives me an error (whether I open the illustrator or eps fil