If you are started learning Linux or any Linux distros (such as Ubuntu,Fedora etc) here is a list of top ten Linux commands for beginners.
Top Ten (10) Linux Commands For Beginners
grep Command
grep command is used to search a string or word in a file. It searches for given arguments by users and return the matching lines.
1 |
grep data employee.txt |
In this command i searched data in employee.txt file. In output, matching line returned.
Output :
Thomas
1 2 |
100 Robin data Sales $5,000 400 Nisha data Marketing $9,500 |
Search a name or string in all files.
1 |
grep -r "raj" * |
r switch is used for recursive search.
How to Copy File and Directory through command.
Shutdown Command
This command is used to shutdown or restart the system.
1 |
shutdown -h now |
Above command shutdown the system immediately.
To restart the system
1 |
shutdown -r now |
pwd command
pwd command is used to check the present working directory.
1 |
pwd |
shows my current working directory
1 |
/home/rajkumar |
wget command
Wget is used to download files. To download files just mention url from where you want to download the files
1 |
wget url |
1 |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb |
Download and store the file with different name through wget
1 |
wget -o chrome https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb |
wget is a very powerful utility to download the files. While downloading the files it shows
1. Download speed
2. Percentage of download completed
3. How much time remainig for complete the downloading
4. You can also specify download speed of a file through wget –limit-rate
ls command to list directory contents
To list all files and directory
1 |
ls |
To view hidden files and directory
1 |
ls -a |
find command – To search for files
1 2 |
find -name employee.txt ./employee.txt |
This command search the file through filename in the current directory and it’s subdirectory.
To specify the location of search
1 |
find / -name employee.txt |
It search the file employee.txt on root and all the subdirectories of root.
free command – To check free and used memory of a system
To check the system free and used memory use this command
1 2 3 4 5 |
free -m total used free shared buffers cached Mem: 1874 1711 163 0 151 381 -/+ buffers/cache: 1178 695 Swap: 1905 337 1568 |
kill command
kill command is used to kill the process. To kill the process mention it’s PID which is a unique number assign to each process.
1 2 |
ps -ef|grep mozilla rajkumar 4301 4161 0 11:03 pts/1 00:00:00 grep --color=auto mozilla |
To kill the mozilla process
1 |
kill -9 4301 |
man command – To get help
Man is your help manual in linux/Ubuntu operating system. If you want to know about any command use man followed by command name.
1 |
man ls |
It shows ls manual page where you get all the details regarding ls command.