Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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'
I want to know if there is a single command to list down all the commands of linux?
That's going to be hard to find. It really depends on what your distro installed, and the options you made when installing. However, most of them will be under /bin and /usr/bin, more important ones which are only usable by the superuser, will be found on /sbin and /usr/sbin. You can list the contents of this directories with ls, of explore them with your explorer of choice.
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.
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
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
That's got the price to the worst measure method ever
First, there are lots of commands that do not have a man page.
To follow with, some others do have many.
And to finish with, man pages are not just for commands. Almost any configuration file out there has it's own man page, C functions has also their own man page, and so on. You probably want to stick to the man1 and man8 subdirs only, since those will be the only sections containing man pages for real commands. Still, it would be way too inaccurate. Some systems might not even have most man pages installed unless you manually install them.
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/.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.