Sudo (Super User DO) command in Linux is generally used as a prefix of some command that only superusers are allowed to run. If you prefix “sudo” with any command, it will run that command with elevated privileges or in other words allow a user with proper permissions to execute a command as another user, such as the superuser. This is the equivalent of “run as administrator” option in Windows.
Syntax:
sudo useradd - To add a new user
sudo passwd - Creating a password for the new user
sudo groupadd - To add a new group
sudo userdel - To delete the user
sudo groupdel - To delete the group
sudo usermod -g - To add a user to a primary group
This command displays all the contents in the present working directory.
Syntax:
$ ls
ls -> By mentioning the path after ls, the content in that path will be displayed
ls –a => Using ‘a’ flag, indexes all the hidden contents in the particular directory
ls –l => Using ‘l’ flag, indexes all the contents with its permissions, owner settings, and timestamp (long format)
Cat(concatenate) command is very frequently used command in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate files.
Syntax :
$cat filename : It displays content of the given file
$ cat > new file : It will create a new file
$cat file 1 > file 2 : It will copy file 1 data into file 2
$cat file 1 >> file 2 : It will copy file 1 data at the end of file 2
The man command is one of the best Linux commands. This command is also known as the manual command. It is used to display the manual use of the given command. In other words, it is the meta-command of Linux. Entering the man command will display all the information about the command.
For example: $man ls => It will display all the information about ls command.
mkdir command is used to make a directory or in other words, it used to create a directory.
The following command will create a new folder called a test folder
$mkdir test