Tuesday, 4 April 2017

Linux Commands Tricks and Tips: Troubleshooting & Multipurpose

You can do all kind of amazing and powerful things with the Linux commands. This becomes the part of your computing experience on a daily basis.

killall

If their is a application running on your computer that is misbehaving like your web browser hangs out or you are not able to close any application. Also some application can be still running in background after closing it. In such a situation killall is vary useful command. This command tell the system to kill the running application.
Example: Lets assume that File Manager application is running, the name of the application in certain Linux Distribution is Thunar. So you can kill that application .....

If the certain application is not running you will get an error message.


touch

It creates an empty file. You can create more than one file at a time.



If you again try to create the same file which has been already created then it just modifies it and update the time. This operation will help to backup the files when your back up software only backup the modified files.



Using touch you can create a flag file. A flag file is a file that can use to tell the system to do something. For example you can do the fsck procedure at boot up. fsck is file system check, it will check whether your file system is alright and their is problem it will then fix it. You have to issue following command.



This flag file will check the file system at the boot up.

which

It tells you where your program is in the computer. When you install any software program then the programs executable files have been stored in different directories of the Linux file system. By using the path you can create a launcher on the desktop for quick access.
For most of the system administration scripts you have to use the absolute path of the installed program, in such a situation you can use the which command.



You can check whether a software is installed or not on your system.


ping

This command is use to check the network connectivity. It can be used the network problems and can be used to check whether the browser is working or not.
This command ask the server to send some information for checking that the site or network is been reached or not.



-c option is used to get the information from the server for only three times. If we run the ping command without the -c option then it will suns continuously.


cat, more & less

cat command is used to view the file. cat command is useful to view the file if it is small but for the large file you have to scroll. The functionality of scrolling would not be available in some terminals like TTY. In such a situation less command is useful. Using less command you can see the long file by scrolling using arrow keys or you can change the page up or down using space key. The more command is similar to less command but you only change the page.


blkid

If you want to see the drives or devices connected to your system then you can check it with the blkid command. You can also get the UUID of each device and drives. This UUID is very useful if their is a problem in mounting or un-mounting the devices.


sudo -s

In most of the Linux distributions the root permissions are locked when you start the terminal. If you want to change the privileges from normal user to root user then you can use the option -s with the sudo command. Their is no need for giving the password. This can be useful when you want to execute most of the command which needs root permission.
But use this command carefully because by mistake you can accidentally change the system configuration since for changing the system configuration you need root access.
You can get back to normal user by typing exit command.


reboot and shutdown

reboot command is used to reboot the system. This can be necessary after installing any  software  to change the system settings. The shutdown command is shut down your system. You can tell the system the time after that it will shutdown using -h option.

$sudo reboot
$sudo shtdown -h 15

man

This command is very very important command. Using man you can read the manual page for any installed command or package of the system. Linux has the information manual for each of the command. You will see the use of the command and the different options for that command in the manual page. Press q to exit from the manual page.


Most Important Linux Commands



No comments:

Post a Comment