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 ?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.