Wednesday, August 14, 2013

FAQs by Linux Newbies

How do I become "root"?
To become "root" on a Linux system, type :
su -
You will be prompted to enter your root password (you set this while installing your OS), entering which you will become the root of the system. Becoming the root will give you access to all the commands on the computer.
How do I change the GRUB boot order?
GRUB boot order can be configured using the file /etc/default/grub . Use the following command :
gedit /etc/default/grub
This command opens a window with the GRUB file. In this file, you will notice that there's a line :
In the list that appears at the start up, the Linux OS appears first. Here, the indexing starts from 0. So the first option on the list will have a value 0, second option has value 1 and so on. Check the position of your Windows OS and change the value of GRUB_DEFAULT.
Also, if you can change the amount of tume you have to wait during the boot time by changing the value of GRUB_TIMEOUT.
How do I untar a .tar.gz file?
Any compressed file can be decompressed by choosing "Extract Here" after right clicking on the file.
Command to untar a file is :
tar -xvzf 
Is there a Task Manager equivalent in Linux?
Yes there is. While logged in as root, type
ps -ax |more
ps -aux |more
You will get a list of all processes running on your computer. You will see the process id (PID), process status (STAT) various statistics, and the command name. You can kill a process by typing "kill" and the PID number right afterwards similar to the line below.
kill 1721
You can also stop and restart processes by sending them various signals as in the below examples:
kill -STOP 1721 - Stops (suspends) process 1721 by sending the STOP signal to the process. This process will still be on the task list. The process can't catch or ignore the STOP signal.
kill -CONT 1721 - Continue process 1721 causing it to resume. The CONT signal is sent to the process.
kill -TERM 1721 - Terminates process 1721 by sending the TERM signal to the process. This process will no longer show up on the task list if it is actually terminated. Process terminated cannot be continued. The TERM signal can be caught so TERM is not guaranteed to kill the process.
kill -HUP 1721 - Stops, then restarts process 1721. This is usually done when a process is not working properly or the configuration files for that process have been changed. This command sends the HUP signal to the process which means hangup. This signal can be caught by the process.
killall -HUP myprint - Restarts any process with the name "myprint".
kill -TERM myprint - Terminates any process with the name "myprint".

No comments:

Post a Comment