• Search for files in the given directory, hierarchically starting at the parent directory and moving to sub-directories.
/> find -name *.sh
/> find -iname *.SH ( find -iname *.Sh / find -iname *.sH)
/> find -name *.tar.gz
• The ‘grep‘ command searches the given file for lines containing a match to the given strings or words. Search ‘/etc/passwd‘ for ‘tecmint‘ user.
/> grep tecmint /etc/passwd
/> grep -i TECMINT /etc/passwd
/> grep -r "127.0.0.1" /etc/
• The ‘man‘ is the system’s manual pager.
/> man man
• ps (Process) gives the status of running processes with a unique Id called PID.
/> ps -A
/> ps -A | grep -i ssh
• The ‘whereis‘ command is used to locate the Binary, Sources and Manual Pages of the command. For example, to locate the Binary, Sources and Manual Pages of the command ‘ls‘ and ‘kill‘.
/> whereis ls
/> whereis kill
• The ‘service‘ command controls the Starting, Stopping or Restarting of a ‘service‘. This command make it possible to start, restart or stop a service without restarting the system, for the changes to be taken into effect.
/> service apache2 start
/> service apache2 stop
• alias is a built in shell command that lets you assign name for a long command or frequently used command.
/> alias l='ls -l'
/> unalias l
/> alias cd='ls -l' (set alias of ls -l to cd)
/> alias su='pwd' (set alias of pwd to su)
• Report disk usages of file system. Useful for user as well as System Administrator to keep track of their disk usages. ‘df‘ works by examining directory entries, which generally are updated only when a file is closed.
/> df
• Estimate file space usage. Output the summary of disk usages by ever file hierarchically, i.e., in recursive manner.
/> du
• This command print files named on command line, to named printer.
/> lpr -P deskjet-4620-series 1-final.pdf
• Now, let’s compare two files
/> cmp file1.txt file2.txt
• Wget is a free utility for non-interactive (i.e., can work in background) download of files from the Web. It supports HTTP, HTTPS, FTP protocols and HTTP proxies.
/> wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
• Mount is an important command which is used to mount a filesystem that don’t mount itself. You need root permission to mount a device.
/> mount /dev/sdb1 /dev/usb
• ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary.
/> ifconfig -a
/> ifconfig eth0 down
/> ifconfig eth0 up
/> ifconfig eth0 192.168.1.12
/> ifconfig eth0 netmask 255.255.255.0
/> ifconfig eth0 broadcast 192.168.1.255
/> ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255
• netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.
/> netstat -a
/> netstat -at
/> netstat -s
/> netstat -an
/> netstat -c
• nslookup is a network utility program used to obtain information about Internet servers. As its name suggests, the utility finds name server information for domains by querying DNS.
/> nslookup tecmint.com
/> nslookup -query=mx tecmint.com
/> nslookup -type=ns tecmint.com
/> nslookup -type=any tecmint.com
/> nslookup -type=soa tecmint.com
/> nslookup -port 56 tecmint.com
• dig is a tool for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information. This tool can be used from any Linux (Unix) or Macintosh OS Xoperating system. The most typical use of dig is to simply query a single host.
/> dig tecmint.com
/> dig tecmint.com +noauthority
/> dig tecmint.com +noadditional
/> dig tecmint.com +nostats
/> dig tecmint.com +noanswer
/> dig tecmint.com +noall
• lsof stands for “list open files” and displays all the files that your system has currently opened.
/> lsof
• Find a keyword and replace in the files *.cpp recursively.
/> find ./ -name '*.cpp' -print0 | sudo xargs -0 -n
• mysqldump commands dumps (backups) all or a particular database data into a given a file.
/> mysqldump -u root -p --all-databases > /home/server/Desktop/backupfile.sql
• Keeping track of memory and resources is as much important, as any other task performed by an administrator, and ‘free‘ command comes to rescue here.
/> free -h
• This command create a new ext4 file system on the specified device, if wrong device is followed after this command, the whole block will be wiped and formatted, hence it is suggested not to run this command unless and until you understand what you are doing.
/> mkfs.ext4 /dev/sdb1 (sdb1 block will be formatted)

- Gokhan YesilyurtLead Nuclear Engineer @ X Energy, LLC in Greenbelt, MD 20770