LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-25-2019, 12:17 PM   #1
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Rep: Reputation: 51
command not found under su


Ok, so just recently installed Debian 10 on my new file server after running Debian 6 for a while. So far things are going pretty good, except one little thing.

If I do an su to root from a regular user and run an application...sometimes I get a "command not found". Some commands will work but others (one of these is fdisk) will give a command not found.

I have never came across this in my past (guess I got lucky) Linux experience, and at least from what I have read so far it relates to the PATH in my .profile files. The thing is, I'm not sure which config/profile file I need to edit for this AND what directories to add to allow my programs to work.

I don't mind doing this under the normal root login (where it appears like most all apps work) but sometimes it's just quicker to su to make a quick fix.
 
Old 10-25-2019, 12:25 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729Reputation: 3729
Look at using the -l option if you want the normal login environment for the target account. That would then include the PATH variable.
 
1 members found this post helpful.
Old 10-25-2019, 02:12 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,758

Rep: Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930
To elaborate on the previous post when you login using just su your still using that users path environment not root's. I have not compared the default path environment between the two versions but it appears that /sbin is not included for a regular user.

However, using su - or su -l will switch to root's environment. You will notice when using su - that you are switched to root's home directory but su you remain in that directory.

Last edited by michaelk; 10-25-2019 at 02:34 PM.
 
1 members found this post helpful.
Old 10-25-2019, 02:32 PM   #4
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
I gave it a shot and it works fine. Thanks turbocapitalist and michaelk! And thanks michaelk for the additional details, that helped a lot.
 
  


Reply



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
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
"Command not found" on my server? “bash: sudo: command not found”? MilesOfRoses Linux - Server 7 04-01-2016 09:19 AM
[SOLVED] complete noob question. "command not found" "command not found" jeanlucpicard Linux - Newbie 4 08-27-2013 02:14 AM
Directory not found; -xzvf not found; Makefile not found RealGomer Linux - Software 4 09-20-2010 10:02 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM

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

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