LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-04-2008, 08:47 AM   #1
ifeatu
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 68

Rep: Reputation: 15
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?!
 
Old 10-04-2008, 09:01 AM   #2
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
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 ???
 
Old 10-04-2008, 09:05 AM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by ifeatu View Post
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?!
"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.)
 
Old 10-04-2008, 09:09 AM   #4
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
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
 
Old 10-04-2008, 10:25 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 10-04-2008, 03:14 PM   #6
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
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
 
Old 10-04-2008, 03:22 PM   #7
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 10-05-2008, 03:41 AM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by david1941 View Post
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.
 
Old 10-05-2008, 10:27 PM   #9
ifeatu
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 68

Original Poster
Rep: Reputation: 15
thank you!

Thank you all for your responses loads of help...I'll give you feedback once I take all suggestions into account.
 
Old 10-06-2008, 11:08 AM   #10
ifeatu
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks

Quote:
Originally Posted by david1941 View Post
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!
 
  


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
commands stored into variables? benne Programming 2 11-15-2004 07:20 PM
Editing stored Terminal commands ShaanAli Linux - Software 2 01-13-2004 07:55 AM

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

All times are GMT -5. The time now is 01:35 PM.

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