10 most frequently used commands in Linux for beginners
To all the beginners of linux, I would like to write 10 most frequently used linux commands with a few examples. Please note that the commands have a lot of options, which need to be explored by the user.
ls
Stands for listing Example : ls Lists all the files in the current directory. ls -l : Stands for long listing. Example : ls -l Displays a long list of files including file permissions, users, date and time of file creation, file size etc. ls -a : List all Example : ls -a lists all the files including the hidden filesmkdir
Stands for make directory. This command is used to create a directory. Example: mkdir dirnamepwd Stands for present working directory. Example : pwd Displays the current working directory that the user is in.
cp
Stands for copy Example: cp filename dirname/ copies file with filename to the directory dirname/ cp -r :recursive copy Example : cp -r dirname1/ dirname2/ copies the entire directory dirname1/ to the directory dirname2/mv
Stands for move Example :mv filename1 filename2 Used to change the filename from filename1 to filename2 wihout changing the contents of the files.find
Example: find lists all the files and directories in current directory recursively Example : find dirname/ lists all the files in the directory with dirname/rm :Stands for remove Example : rm somefile removes the file with name ‘somefile’ in the current directory. rm -rf Stands for recursive forceful remove Example : rm -rf dirname/ remove the entire directory with the dirname
cd Stands for change directory.
Example 1
: cd ~/dirname/ Changes the current directory to /home/username/dirname/Example 2
: cd .. Changes the directory to a previous directory 9. df Stands for disk free Example : df Displays the entire disk space available. df -h : Disk free in human readable form Displays the entire disk space in terms of GB, MB etc.User Manual. Gives the detailed description of the command with options.
1#Example
2#man command_name
3man ls
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>Example HTML5 Document</title>
6</head>
7<body>
8 <p>Test</p>
9</body>
10<!-- this line is extraneous 2Error from server (Forbidden): deployments.apps is forbidden: User "chiptest" cannot create resource "deployments" in API group "apps" in the namespace "default" -->
11</html>