Tuesday, 19 April 2016

A handful of Linux commands every user should know

A handful of Linux commands every user should know

Many of us techies use Linux, the many implementations of the same kernel, under different names such a Ubuntu, Linux Mint and Fedora to name a few. But no matter how different we are at the surface, the kernel is always the same, Linux. :) It is like Hinduism, following different gods or goddesses who actually are different manifestations of the same reality, Brahman. 

Our friendly neighbourhood penguin
Well, new users often mess up their desktops trying to cultivate the maximum from their systems, and this often creates problems. So, there are a couple of special commands which should be kept in mind while using linux, to help you fix small annoyances. Some of these important command sets are: 

killall -user <username>

We often find unresponsive systems, where the GUI might have crashed, or simply there might not be enough RAM to keep the system running. This often leads to GUI failures, and the only way seems to be rebooting the machine. But when you're on Linux, you have the power of Virtual Consoles at your disposal. Simply fire up a console using the combination Ctrl+Alt+F2 (you may use anything from F1 to F6, but using F1 is not recommended since it's mostly used for debugging), enter your login ID and password, and you've a working CUI console. 

Now, type the command

killall -user <username>

Once you master it, shell can be your best friend and ally :)
and it terminates all the processes being run under your user account, and takes you back to he login screen. (If it doesn't automatically switch to Login screen, you may need to manually press Ctrl+Alt+F7 to switch back to GUI mode). Login again, and you've your system ready without rebooting. 

sudo killall -user root

This is an extension of the previous command, and should only be used with extreme care. It terminates nearly all processes running, and takes you back to the login screen. The difference is, it has superuser rights. So, this command terminates processes under root account as well. Not recommended to do so unless there is extreme emergency. 

sudo reboot

This command quickly restarts the system, so that you can resume working. 

sudo pkill <processname>

One of the most common mistakes new users make in Linux is that, they give the command 'kill <procname>', not realizing that 'kill' command requires the process ID, not the name itself. 'pkill' is much better, since it works directly with the name of the process. For example, say your system got stuck while updating. You can't terminate the process using the GUI. The best thing is to fire up your terminal and enter 'sudo pkill aptitude' (or 'sudo pkill apt-get' if you're using apt-get), and it immediately kills the process, allowing you to resume working on your system. 

A list of common Linux commands, you may set it as your wallpaper

sudo dpkg -i package.deb

This is an installation command. Many users find themselves unable to install a .deb package directly, especially if they don't have Gdebi or any of those GUI deb installers. But simply there's no need of those front-ends. Just shoot your terminal, change the directory and enter the above command, and your package gets installed quickly. Here, -i parameter is for installation. 

No comments:

Post a Comment