7. Linux Commands
7.1 sudo
Super User Do
This runs one command with the privileges of a specified user. If user is not specified, root us assumed
The user who is running the command must have already added into sudoers list.
So, following runs only one command without root permission at a time
sudo vi
# this asks for password of current user (not the root user password)
# ubuntu don't ask password for 15 mins default once password is given.
Trick:
Sometimes, we need to login as different or root user, for that
sudo --login --user=root # if --user is not given, it is defaults to root.
Then we get the root prompt. (provided, we are into sudoers list)
This is much better than running the su
command. Because, root password is not shared here.
7.2 su
Switch user su root # switch to root. We need to enter password of root. This command is different from sudo. means, - su asks for root password, gives new terminal with root privilege and . - sudo asks for current user password (not root passwd) run one cmd with root privilege
7.3 mount command
How to mount a file system?
What are FS types
- procfs
- tempfs
- sysfs
- devpts
- overlay