LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-30-2006, 03:27 PM   #1
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Rep: Reputation: 38
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.
 
Old 01-30-2006, 03:30 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,783

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Open a console and enter this command: man bash. That will list all the commands that bash uses, complete with command options.
 
Old 01-30-2006, 03:54 PM   #3
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
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.
 
Old 01-30-2006, 04:26 PM   #4
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Original Poster
Rep: Reputation: 38
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
 
Old 01-31-2006, 12:29 AM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

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

Last edited by perfect_circle; 01-31-2006 at 12:31 AM.
 
Old 01-31-2006, 08:09 AM   #6
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,493

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
Old 01-31-2006, 01:54 PM   #7
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
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.
 
Old 01-31-2006, 03:10 PM   #8
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,493

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
what would you mean exactly, by a GUI command?
 
Old 02-01-2006, 03:38 AM   #9
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
I mean a command that needs X-Server, like firefox.
A command that is useless unless you run X-Window
 
Old 02-01-2006, 07:38 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic shell commands pppaaarrrkkk Linux - Newbie 7 02-05-2007 07:31 AM
Commands/Shell script ?? paraiso Linux - Newbie 11 04-21-2005 10:58 AM
Fedora Shell Commands tregg Fedora 3 01-12-2005 04:52 AM
shell commands! krishlinux General 1 10-05-2003 04:47 AM
how to delete old shell commands a_hic Linux - Newbie 4 05-01-2003 06:16 AM


All times are GMT -5. The time now is 03:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration