Mos of us are not comfortable with command line arguments (CLI) and its really not necessary. It is important, of course, to know how to use the command-line terminal – and anyone who can manage typing, backspacing, and cutting and pasting can manage the command-line terminal (it is not more difficult than that). Here are some basic commands with explanation:
Where to write command:
To write a command ones needs to go to terminal. To go terminal use one of the following approach. I am using Ubuntu 14.04 version.
Dash -> Search for Terminal
Dash -> More Apps -> ‘See More Results’ -> Terminal
Dash -> More Apps -> Accessories -> Terminal
Keyboard Shortcut: Ctrl + Alt + T
Most of the following commands will need to be prefaced with the sudo command. It allows authorized users (normally “Administrative” users; for further information please refer to AddUsersHowto) to run certain programs as root without having to know the root password.
This means that in the terminal you should use sudo for commands that require root privileges; simply prepend sudo to all the commands you need to run as root. For more extensive usage examples, please see below. Similarly, when you run GUI programs that require root privileges (e.g. the network configuration applet), use graphical sudo and you will also be prompted for a password (more below). Just remember, when sudo asks for a password, it needs YOUR USER password, and not the root account password.
To repeat the last command entered, except with sudo prepended to it, run:
To add a new user with root privilage
In the terminal (for Precise Pangolin, 12.04), this would be:
sudo adduser <username> sudo
where you replace <username> with the name of the user (without the <>).
In previous version of Ubuntu
sudo adduser <username> admin
Logging in as another user
Please don’t use this to become root, see further down in the page for more information about that.
sudo -i -u <username>
For example to become the user amanda for tape management purposes.
sudo -i -u amanda
The password being asked for is your own, not amanda’s.
Enabling the root account
To enable the root account (i.e. set a password) use:
sudo passwd root
Re-disabling your root account
sudo passwd -dl root
Reset sudo timeout
You can make sure sudo asks for password next time by running: