history- To view the list of commands executed in a terminal- CTRL-R activates the reverse-i-search to search for a command
script- Capture a terminal work session in a file- To exit type
exitoCTRL-D
- To exit type
which pname- Lets you know which version of pname you are using
whoami- Indicate your usernameid- Information about the identity and the group to which it belongswho- Indicates who is currently connected to the machine
Config file: /etc/sudoers
Configure sudo (add user username to sudoers) two ways:
- A:
- Become root via
su - - Launch the command
visudo - Add the line
username <tab> ALL=(ALL:ALL) <space> ALL - Type
adduser username sudo
- Become root via
- B:
adduser username sudo
- To save changes logout and re-login
su - root
sudo -i - Open terminal session
shutdown [-h|-r] now
- -h shutdown
- -r restart
- -now when to perform the action
Useful for storing complex command lines into commands that are easier to invoke.
alias aliasname='commands'