Where are my commands stored?
Where are my commands and scripts stored?
I was under the impression that they'd be (by default) installed in bin and sbin...I'm running Fedora 9. When I attempt to run a command like modprobe in BASH it says the command is not found...I've tried /sbin/modprobe...any other suggestions?! |
locating commands
hi,
well i am not an expert but i think you are right - all the commands are un /bin or /sbin. So if you say that the command is not found - it simply might no be there - BTW are you trying lsmod ??? |
Quote:
Also small number of commands isn't stored anywhere (modprobe isn't one of them), but are built into shell interpreter (bash, sh, etc.) |
I use the command "locate something" (see man locate) to get a list of "something" that is included in the full name of files on the system. This list is usually updated daily by cron, and will not include a recent addition. But the database can be updated by running "updatedb", so after installing something, run updatedb before "locate".
Dave |
Programs that require root access will be found in /sbin/ or /usr/sbin/. These paths are not in a regular users PATH variable by default. /sbin/ will contain your core administrative programs that you need to operate and manage a system. Some commands like mkinitrd may be bash or perl scripts. They are in /sbin/ or /user/sbin/ as well. Scripts that you write yourself normally go in ~/bin/.
The /usr/ directory is an alternate install base with it's own hierarchy for user programs. It contains the same bin/,sbin/,lib/ directories for user packages. The /usr/local/ directory is another alternate directory hierarchy, also containing many of the same bin/, sbin/, lib/ subdirectories. It is intended for packages you install from source that are independent of your distro. The distribution will not touch the contents /usr/local during an upgrade or install. You may want this directory to be mounted on its own partition, and not format this partition when performing a fresh install. This will allow you to retain the contents between installs. A package that installs the programs in /usr/bin/ will install the libraries in /usr/lib/. For administrative programs that need root access, use "sudo" and enter the full pathname. |
There is a generally used standard as to where things are in a Linux system described here: http://www.linuxjournal.com/article/1104. But the use is changed dramatically by the user via the $PATH variable. Sometimes a rather simple change in the path will cause different commands to be executed as different commands with the same filename get installed either unknowingly or, unwittingly in improper directories. One should always check the $PATH's effect by running the command which <command> without a path to see if the proper command will indeed be used.
Dave |
On many Linux systems, administrative commands in the */sbin directories can only be run as root unless you append those directories to your path. Some distros e.g. Ubuntu don't follow this convention, but they are not the norm.
|
Quote:
Note also that if you get too much output from 'locate' a formulation like 'locate this | grep -i /sbin' would give just the instances of the string 'this' in filenames within sbin. |
thank you!
Thank you all for your responses loads of help...I'll give you feedback once I take all suggestions into account.
|
Thanks
Quote:
|
All times are GMT -5. The time now is 06:51 AM. |