LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   commands in shell? (http://www.linuxquestions.org/questions/linux-general-1/commands-in-shell-409716/)

kalleanka 01-30-2006 03:27 PM

commands in shell?
 
How do I find out what commands are instald in a bash shell?

Some of them got man pages but are not installed and wise versa and some got an own program in bin etc and some do not. And then its probebly a diffrence in linux/unix etc and all the versions. I want a command that lists all the commands.

thanks. This would be helpfull for me.

bigrigdriver 01-30-2006 03:30 PM

Open a console and enter this command: man bash. That will list all the commands that bash uses, complete with command options.

perfect_circle 01-30-2006 03:54 PM

You are missing something. There is bash, which is a shell and a scripting language interpreter and has some embedded commands and there are many Command Line commands, which will run in any shell, bash, sh, tcsh.... and are under a bin ore sbin folder.
try "man bash" to find out how bash works.
For the other commands, the most important ls, du, rm, etc... are the GNU core utilities and in most cases are packed in a package called coreutils.
All the others command line commands are in other packages. Use your distro's packet manager to find them out. You may search for commands by using the apropos command.
try
Code:

apropos dvd
to find out some commands about dvds.
If you are asking, can somebody tell me a way to list all the command line commands, I think the answer will be no.

kalleanka 01-30-2006 04:26 PM

thanks perfect circle

Thats what i suspected.

Its hard to findout where the command commes from bash, bin, package etc. If its installed and if its dubble installed with diffrent versions? Witch one is used? etc

I think I got a step lerningcurve here.
thanks again

perfect_circle 01-31-2006 12:29 AM

if you install that same version of a command under the same path, the the old executable will be probably overwritten be because they have the same name. In any other chance the one that is default executed depend of the path. In my system the path is:
Code:

skalkoto@darkstar:~$ printenv PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:/usr/local/ns-allinone-2.29/bin:/usr/local/ns-allinone-2.29/tcl8.4.11/unix:/usr/local/ns-allinone-2.29/tk8.4.11/unix:.
skalkoto@darkstar:~$

If 2 directories contain the same command then the first one is executed. If 2 command have the same name, and are stored in
/usr/local/bin and /usr/bin, the one in /usr/local/bin will be executed, unless you use a fullpath:
"/usr/bin/ls". There is also the "which" command that will tell you which command will be executed when you type only the command name in a terminal:
Code:

skalkoto@darkstar:~$ which ls
/usr/bin/ls
skalkoto@darkstar:~$

After installing Crossover office and Microsoft Office, in my system , it created a /usr/bin/winword, but I couldn't use greek in the word because I needed to execute:
Code:

LC_ALL=el_GR /usr/bin/winword
to make the greek function properly. So, instead of changing the existing file, I could easily create a winword file in /usr/local/bin:
Code:

skalkoto@darkstar:~$ cat /usr/local/bin/winword
#!/bin/sh
env LC_ALL=el_GR /usr/bin/winword
skalkoto@darkstar:~$

and the fact that it is placed in /usr/local/bin gave priority in the execution. What I'm trying to say is that if you understand how things work, you can use it for your own benefit.

ntubski 01-31-2006 08:09 AM

Quote:

Originally Posted by perfect_circle
If you are asking, can somebody tell me a way to list all the command line commands, I think the answer will be no.

Well if you type <tab><tab> then answer y, it will show you a list of all possible commands. Not very useful as I doubt you're going to go through a list of 1000+ commands and read the man page for each one.

Certainly, apropos (or man -k) and google will be much more helpful

perfect_circle 01-31-2006 01:54 PM

Quote:

Originally Posted by ntubski
Well if you type <tab><tab> then answer y, it will show you a list of all possible commands. Not very useful as I doubt you're going to go through a list of 1000+ commands and read the man page for each one.

Certainly, apropos (or man -k) and google will be much more helpful

yes but the problem is we want to display only the CLI commands. Not the gui ones.

ntubski 01-31-2006 03:10 PM

what would you mean exactly, by a GUI command?

perfect_circle 02-01-2006 03:38 AM

I mean a command that needs X-Server, like firefox.
A command that is useless unless you run X-Window

pixellany 02-01-2006 07:38 AM

If you have a directory full of executables (ie either binaries or scripts), I am not sure how you would search them based on whether they were dependent on X-windows---or on anything else for that matter.
What is the root problem here---what swamp are we trying to drain?


All times are GMT -5. The time now is 02:10 AM.