Listing all the commands
I want to know if there is a single command to list down all the commands of linux:study:?
|
There is no such thing as 'all commands of linux'. It depends what programs you have installed on your system - for example piping output to ubiquitous 'less' is not gonna give any results if 'less' is not installed. If you are looking for shell built-ins - again that will depend on which shell is installed. For Bash you can do 'man builtins'
|
Quote:
Then launch "man <whatever command>" to read info about that command. Besides that, there are also builtin command on each shell. Most distros use bash as the default shell, but there are many others, and all are different in one or another way. |
If you are running bash, hit Tab Tab and bash will ask you if you want to list all the commands that are currently executable by you.
|
cd /usr/man
then enter: for dir in `ls|egrep "man[[:digit:]]"`;do ls $dir|sed 's/\..*$//';done 12087 entries on my system......but WHY??? Perhaps you did not mean ALL.....;) Any good Linux book will give you the most common ones---eg the Advanced Bash Scripting Guide--free at http://tldp.org |
Quote:
I'm getting a headach....;) |
commands as in executables?
Code:
find / -type f | xargs -i file -N "{}" | grep -i executable | cut -d":" -f1 |
Quote:
If you want to see binary files, look into the bin directories, it's easier and there's no error margin there. The tab completion will also work ok, since what we consider "commands" are always either in our path or as builtins. This would be a more accurate (still, not perfect) measure: Code:
find {/usr/sbin,/sbin,/usr/bin,/bin} -perm 755 -type f | wc -l |
Just an FYI. There are a number of man pages for configuration files and if installed linux and posix system calls. For example, smb.conf has a man page. You may have a number of manpages in /usr/share/man/man1/ which cover linux c library routines. /usr/share/man/man3p/ have posix library routines which are a part of the Posix Programming Manual. So you probably have a lot more man pages then programs.
About 100 of the most common commands are supplied by the coreutils package. You can find documentation for them in the "info coreutils" manual. Most programs will be installed in /bin, /sbin/, /usr/bin/, /usr/sbin/. The ones in an sbin dir are administrative commands and are usually not in a regular users path. I'm not counting Java programs. Java may install it's own java applications in a java directory hierarchy and add a directory to your path. If you add a non-regular version of kde or gnome, it may be installed under /opt/ which will include a full hierarchy such as bin/, sbin/ and lib/. |
Quote:
|
In addition to tldp above, this is a good guide: http://rute.2038bug.com/index.html.gz
|
I confess---I went off on a bit of a tangent. (And I forgot that config files also have man pages).
My main point--perhaps too subtle--is that you really don't want/need to know every single command. |
Besides regular commands, I must confess that I probably have kde apps and libraries I've installed using the package manager and have never gotten around to trying them out.
|
All times are GMT -5. The time now is 03:17 PM. |