LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-17-2007, 02:40 PM   #1
200mg
Member
 
Registered: Jul 2006
Posts: 88

Rep: Reputation: 15
(noob) ? about "command not found" in SW


Sometimes when I'm at the cli or in X in a terminal I will type in a command that I know is there because I just used it 10 seconds ago, but it will come back with "command not found." For instance if i'm in rxvt abd I type "xterm" it will work and then after playing in it for a while I'll type "xterm" again and it will come back with "command not found." This is not limited to x-term, it can happen with just about any command (and no the syntax is not incorrect). I've noticed it when i'm at the cli i'll type "startx" and it will come up, then I'll quit x with ctrl-alt-bckspace, play around in the cli for a while and type "startx" again and it will come back with "command not found" any ideas?

Actually this happens after i try to sudo the command like sudo xterm, type in the passwd, and it says xterm not found, then i su back to root and try just "xterm" and i get the same thing... xterm not found

Last edited by 200mg; 06-17-2007 at 02:43 PM.
 
Old 06-17-2007, 03:05 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
"command not found" means it isn't in your PATH.

If you sudo/su to another user you can be invoking commands that are changing your environment variables including PATH.

PATH variable includes all the directories to look in for executable commands. Each directory is separated by colon ( from the next.

Type "echo $PATH" and you'll see what is in your path.

PATH is typically set initially by /etc/profile and/or /etc/bashrc and then often added to by $HOME/.profile and/or $HOME/.bashrc. It can also be modified by any script or config file executed or sourced by any of those files.

You can see where files are by typing "which <command>" for any command you want to execute (e.g. "which startx"). This will show you which, if any, directories from your PATH contain the command. If none do it will tell you not found in each of those directories.

Note that doing "su -" tells su to invoke the config files for the user you are switchting to (with no user specified you're doing su to root by default) so you might want to look in the target user's $HOME.

HOME by the way is the home directory of the user. echo $HOME will show you what that is after you login or switch user.
 
Old 06-17-2007, 07:01 PM   #3
200mg
Member
 
Registered: Jul 2006
Posts: 88

Original Poster
Rep: Reputation: 15
thanks, I appreciate the reply
 
  


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
"bash: rpm: command not found" errom when trying to install any package sandeepchau123 Linux - General 16 07-06-2008 03:58 AM
Shell: command not found / Runs fine with "Run command" badbunny Linux - Newbie 1 01-22-2007 01:21 AM
executing a loaded module returns "command not found" error neelay1 Linux - Software 1 05-08-2006 02:25 PM
LFS 6.0 error: glibc fails check with "g++: command not found" peristaltic Linux From Scratch 1 03-15-2005 07:52 PM
Benoit's Alcatel - pppd call adsl "command not found" GM287 Linux - Networking 5 04-04-2004 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:07 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