In: Computer Science
Try the Linux commands listed below. Post your thoughts about how to use these commands. Discuss options that you might use with them, compare and contrast them and/or ask questions about commands you are not sure about.
mount and umount
more and less
head and tail
grep
kill / xkill / pkill / killall
su and sudo
man and whatis
ping and traceroute
a) mount command is generally used to mount a storage device or file system, which makes it accessible and attaching it to the existing directory structure.
Whereas, the umount command actually unmounts the mounted file system. It actually detaches the system directory from the file system mount. We use umount command before removing a disk.
b) more command is used to view the file in the command prompt displaying one screen at a time and even allow the user to scroll up and down through the page.
less command is used to view the files without opening the file and allows forward and backward movement of the file.
c) head command displays the content from the top of the result. By default it shows top 10 lines of the result.
Whereas less command displays the content from the bottom of the result. By default it shows bottom 10 lines of the result.
d) grep command is a kind of a filter that is generally used to search a particular pattern and even displays all lines that contains that pattern.
e) Kill: the kil command is used to send a Terminate signal to the process.
kill -9 1924
killall: This is the kill signal works with the process name. It will kill the process by its name
killall -9 firefox
pkill: This command basically send signal to the process based on the name.
pkill demo
Xkill: This command will kill a client by the X resource. It is mainly used to kill the processes that are malfunctioning.
f) Sudo command is used to run a single command using the root privileges.
sudo useradd user_name
su actually means switch user. This command is mainly used to switch from one user to another.
su - user_name
g) whatis actually displays the one line manual page description.
man is the system's manual viewer. It can be used to display the manual page.
h) Ping command is the utility which basically helps to check the connectivity between two systems.
traceroute command is used to trace the packet fro your computer to the host and even shows the hops from the source system to destination system.