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.
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?!
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?!
"commands" are normally stored in /bin, /usr/bin, /usr/local/bin and /sbin. modprobe is stored in /sbin, and you can't ran it as normal user, only as root (either log in as root, or use su or sudo). Anything in /sbin isn't supposed to be run as non-root user.
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".
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.
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.
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
That's what I do too, but you have to take into account that increasingly distros don't install 'locate' (sometimes called 'slocate' as a package, or is part of a bigger group) by default. I think this is because of the increasing number of gui/desktop search options, but, whatever the cause, the OP might have to install an extra package to get it.
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.
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
Thanks so much for this!! This is what I was looking for!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.