Get all commands from unix

Discussion in 'Java' started by Yadagiri Rao KP, Aug 7, 2003.

  1. I am doing a assignment which involves getting all possible unix
    commands and add to to a list box.
    Firstly I used Runtime and Process classes and used the "env" as an
    arguement to process.
    but where all commands are stored in order to retrieve?
    pls help
    Yadagiri Rao
     
    Yadagiri Rao KP, Aug 7, 2003
    #1
    1. Advertising

  2. Yadagiri Rao KP wrote:
    > I am doing a assignment which involves getting all possible unix
    > commands and add to to a list box.
    > Firstly I used Runtime and Process classes and used the "env" as an
    > arguement to process.
    > but where all commands are stored in order to retrieve?
    > pls help
    > Yadagiri Rao


    Try to list the files under /bin/
     
    Ahmed Moustafa, Aug 7, 2003
    #2
    1. Advertising

  3. On 6 Aug 2003 22:41:34 -0700, Yadagiri Rao KP wrote:
    > I am doing a assignment which involves getting all possible unix
    > commands and add to to a list box. Firstly I used Runtime and
    > Process classes and used the "env" as an arguement to process. but
    > where all commands are stored in order to retrieve?


    Get the PATH variable, a list of directories separated by ':'. The
    possible commands for the current user are found in those directories.
    You'll probably also need to consider the permissions associated with
    each executable along with the identity (user and groups) of the
    current user, since the existence alone of a file in one of those
    directories doesn't mean that you can run it.

    /gordon

    --
    [ do not send me private copies of your followups ]
    g o r d o n . b e a t o n @ e r i c s s o n . c o m
     
    Gordon Beaton, Aug 7, 2003
    #3
  4. Gordon Beaton <> writes:

    > Get the PATH variable, a list of directories separated by ':'. The
    > possible commands for the current user are found in those
    > directories. You'll probably also need to consider the permissions
    > associated with each executable along with the identity (user and
    > groups) of the current user, since the existence alone of a file in
    > one of those directories doesn't mean that you can run it.


    That still won't get all commands inherent in the user's shell - not
    all of them need exist in program form.

    A potential solution could be to scan the files in "man" section 1.
     
    Tor Iver Wilhelmsen, Aug 7, 2003
    #4
  5. (Yadagiri Rao KP) wrote in message news:<>...
    > I am doing a assignment which involves getting all possible unix
    > commands and add to to a list box.
    > Firstly I used Runtime and Process classes and used the "env" as an
    > arguement to process.
    > but where all commands are stored in order to retrieve?
    > pls help
    > Yadagiri Rao


    Look at all the executable files in all the directories in the
    environment variable PATH.

    Will
     
    William Dowling, Aug 7, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yadagiri Rao KP

    Run unix commands from Java

    Yadagiri Rao KP, Aug 5, 2003, in forum: Java
    Replies:
    2
    Views:
    7,840
    Dave Miller
    Aug 5, 2003
  2. Spendius
    Replies:
    2
    Views:
    2,977
    Rogan Dawes
    Dec 13, 2004
  3. Jerome
    Replies:
    3
    Views:
    14,088
    Juha Laiho
    Jan 24, 2005
  4. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,977
    Thomas Stegen
    Jun 28, 2003
  5. Tim Stanka
    Replies:
    1
    Views:
    806
    Jeff Epler
    Aug 2, 2004
Loading...

Share This Page