LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-17-2008, 10:57 PM   #1
IshanJ
LQ Newbie
 
Registered: Aug 2008
Posts: 13

Rep: Reputation: 0
Listing all the commands


I want to know if there is a single command to list down all the commands of linux?
 
Old 09-17-2008, 11:06 PM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
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'
 
Old 09-17-2008, 11:08 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
Quote:
Originally Posted by IshanJ View Post
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.
 
Old 09-17-2008, 11:19 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
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.
 
Old 09-17-2008, 11:36 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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
 
Old 09-17-2008, 11:39 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by Mr. C. View Post
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.
Hmmmm......my system gives 3521. That leaves 8566 commands that have man pages, but that I cannot use.
I'm getting a headach....
 
Old 09-18-2008, 12:00 AM   #7
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
commands as in executables?
Code:
find / -type f  | xargs -i file -N "{}" | grep -i executable | cut -d":" -f1
 
Old 09-18-2008, 12:17 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
Quote:
Originally Posted by pixellany View Post
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
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

Last edited by i92guboj; 09-18-2008 at 12:18 AM.
 
Old 09-18-2008, 12:34 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
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/.
 
Old 09-18-2008, 12:47 AM   #10
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Quote:
Originally Posted by pixellany View Post
Hmmmm......my system gives 3521. That leaves 8566 commands that have man pages, but that I cannot use.
I'm getting a headach....
My more sane BSD system has a mere 1228. The OP asked for a full list - the headache belongs to the requester.
 
Old 09-18-2008, 02:24 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,174

Rep: Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681
In addition to tldp above, this is a good guide: http://rute.2038bug.com/index.html.gz
 
Old 09-18-2008, 08:00 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 09-18-2008, 10:26 PM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM
Suse Linux Commands For These Aix Commands? Vaskar Guha Linux - Software 2 12-19-2005 12:45 AM
Listing Commands Blackout_08 Fedora 2 03-07-2005 09:57 AM
Listing All Commands? Rv5 Linux - General 4 09-30-2003 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration