Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sudo explanation and example pls

Status
Not open for further replies.

h3nd

Programmer
Jul 1, 2006
147
AU
Hi guys,

I was trying to delete files in unix which not belong to me, which means I am not the owner on that files. So I couldn't delete it. And my senior told me to sudo first then I could delete it.

Just wondering what sudo is for ? how do I use it ?

Thanks guys
 
Just prefix the command with "sudo":[tt]
sudo rm filename[/tt]
If you are permitted to use sudo, then you may be asked to enter your password to continue.
 
I think your senior might have been confusing su and sudo. sudo allows you to run commands as the super user or another user, but only as long as rules have been previously been added to the sudoers file allowing you to run those commands. sudo can be configured to allow you to run the commands without being asked for a password.

su ("substitute user", often incorrectly called "super user") allows you to temporarily become the super user or any other user to run any commands as that user. You need the password for that user to use this, unless you are already logged in as the super user. Usually you would use su - to make it read the environment for that user as well, for example their .profile.

Annihilannic.
 
you could check your sudo athority by typing "sudo -l" from the command line. If it says you have rm authority, then type "sudo rm file2delete
 
K, guys Thx, unfortunately they required me any password so, I can't use it obviously.

Is there any way to delete someone's file without su/sudo access? I guess not.
 
Unless the permissions on the directory containing the file allow you to delete it, no.

Annihilannic.
 
Is there any way to delete someone's file without su/sudo access?
Ask your sysadmin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top