Linux is distributed freely under GNU. Since Linux became a buzzword many organizations have started offering professional support and there are many sites on the Net where Linux questions are answered for free. There is a number of commands available.
Let’s decryptinfo about the top 30 Linux commands
1. uname command
This command displays Linux system information
2. uptime command
This command shows the current time, how long the system has been running, the number of logged-in users, and the load of the current system
3. hostname command
This command generally displays the system hostname. The information system generates stored in /etc/hostname file.
4. whoami command
whoami command shows the name of the user logged in the system. ‘w’ command can show detailed information for logged in users. who command can also be used to check who is logged in to the system
last command show listing of last logged in the system. last command searches back through file /var/log/wtmp. lastb command is the same command like last, except that by default it shows a log of the file /var/log/btmp, which contains all the bad logins. the last reboot shows system reboot history
6. dmesg command
This command detects hardware and boot messages. The default output of command prints or control the kernel ring buffer
7. cpuinfo command
cpuinfo command shows detailed information about CPU model, cpu family, model name, cpu frequency, cache size, cpu cores, etc.
8. meminfo command
meminfo command shows the details about Hardware/physical memory attached to the system. Its displays total memory, active, inactive, swaptotal, swapfree, etc information
9. free command
This command shows the amount of free memory and used physical and swap memory in the system also buffers and cache used by the kernel. This information is gathered by parsing /proc/meminfo
10. pwd command
pwd command as name Present working directory, it displays the path of the current directory.
ls command listing about files and directories (the current directory by default)
mv command is used to move a file or directory from one location to another. mv command can also be used for the rename the file.
mv oldfilename newfilename ( this will work as renaming oldfilename to new filename. In this case path of both files should be same)
13. cp command
cp command is used to copying files and directories from one to another path. cp -r command can be used to copy the whole directory to the next path if the directory does not exist.
cp -r directory1 directory2, (create dir2 if it doesn’t exist)
14. touch command
The touch command is used to create or update files. touch can change the access and/or modification times of the specified files.
more command outputs the content of the file. more is a filter for paging through text one screenful at a time.
head command displays first 10 lines of file as standard output. -n switch can be used to the customized number of lines.
17. tail command
tail command displays the last 10 lines of the file as standard output. similar to the head command -n switch can be used to alter the output.
Full abbreviation of wc is Word Count, as the name suggests it print the number of bytes, words, and lines in files. A word is a non-zero-length sequence of characters
delimited by white space. The options below may be used to select which counts are printed, always in the following order: newline, word, character, byte, maximum line length.
19. ps command
ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top(1) instead.
ps command accepts several kinds of options:
- UNIX options, which may be grouped and must be preceded by a dash.
- BSD options, which may be grouped and must not be used with a dash.
- GNU long options, which are preceded by two dashes.
20. top command
The top program displays all running processes and a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel.
The command kill sends the specified signal to the specified process or process group. It kills the process with the mentioned pid id.
22. ip addr command
It displays all network interfaces and ip address.
23. find command
‘find’ searches the directory tree rooted at each file name FILE by evaluating the EXPRESSION on each file it finds in the tree.
Nslookup is a program to query Internet domain name servers. It has two modes: interactive and non-interactive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.
25. wget command
Wget is a utility for non-interactive (works in the background)download of files from the Web. It supports HTTP, HTTPS, and FTP protocols.
26. netstat command
It listing all active listening ports, network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
27. df command
Full form of df is disk free, as the name suggests it df displays the amount of disk space available on the file system containing each file name argument
28. du command
Full form of du is disk usage, du summarize disk usage of each FILE, recursively for directories
29. mount command
The mount command serves to attach the filesystem found on some device to the big file structure. unmount command is used to detach the device,
30. findmnt command
findmnt will list all mounted filesytems or search for a filesystem. The findmnt command is able to search in /etc/fstab, /etc/mtab or /proc/self/mountinfo. The command prints all mounted filesystems in the tree-like format.