Top Ten (10) Linux Commands For Beginners
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.
grep data employee.txt
In this command i searched data in employee.txt file. In output, matching line returned.
100 Robin data Sales $5,000
400 Nisha data Marketing $9,500
Search a name or string in all files.
grep -r "raj" *
r switch is used for recursive search.
This command is used to shutdown or restart the system.
shutdown -h now
Above command shutdown the system immediately.
To restart the system
shutdown -r now
pwd command is used to check the present working directory.
shows my current working directory
Wget is used to download files. To download files just mention url from where you want to download the files
Download and store the file with different name through wget
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
To view hidden files and directory
find command – To search for files
find -name employee.txt
This command search the file through filename in the current directory and it’s subdirectory.
To specify the location of search
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
total used free shared buffers cached
Mem: 1874 1711 163 0 151 381
-/+ buffers/cache: 1178 695
Swap: 1905 337 1568
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.
ps -ef|grep mozilla
rajkumar 4301 4161 0 11:03 pts/1 00:00:00 grep --color=auto mozilla
To kill the mozilla process
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.
It shows ls manual page where you get all the details regarding ls command.