Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Does this happen also after a reboot? Killing a single process does not always kill everything related to an application. A single launch of Firefox, for example, has more than a single process running, and to kill it, you need to kill all related processes for a clean start.
There can be many reasons for a program to "hang".
Some of the utilities you can use to find out what's going on are;
'ps' - this will show you a list of running processes (you may want to run something like 'ps aux' to get more detail) including how much memory they use, what their current state is, their PID (process ID) etc etc. Can be very instructive.
Another good tool is 'top'. This will show you what processes are using a lot of CPU time, memory etc, show you the load of the system in general and various other details. It's a great way to get a snapshot look at how the system currently performs.
The 'vmstat' tool can show you details about memory use, page ins, page outs etc. You run it with an update frequency in seconds, like 'vmstat 3' and it then shows you a line with various details about the system memory utilization and more every <interval> seconds.
'sar' can be used to see how the system has performed over time.
If you want to see what a running process is currently doing, then strace, ltrace (or even gdb - the GNU debugger) are your friends. 'strace' will dump a log of the system calls the program is executing. 'ltrace' shows library calls the program is making. And 'gdb' is a interactive debugger allowing you complete inspection of the programs runtime state.
All 3 programs can be run as 'strace progname' to start <progname> under the tool, or you can use 'strace -p <pid>' to attach the tool to a running process id (same for ltrace and gdb).
You can also find various details by using 'ls -l' and 'cat' to view files in /proc/<pid_of_program>/
Read the 'man' pages for the tools I've mentioned and you should be well on your way to discovering why your programs "hang".