Get all commands from unix

  • Thread starter Yadagiri Rao KP
  • Start date
Y

Yadagiri Rao KP

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
 
A

Ahmed Moustafa

Yadagiri said:
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/
 
G

Gordon Beaton

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
 
T

Tor Iver Wilhelmsen

Gordon Beaton said:
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.
 
W

William Dowling

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top