What Linux is and shell script with process

What Linux is and shell script with process - Processes...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Processes " A process is program (command given by user) to perform specific Job. In Linux when you start process, it gives a number to process (called PID or process-id), PID starts from 0 to 65535. " For e.g. To find how many files do you have on your system you may give command like: $ ls / -R | wc -l This command will take lot of time to search all files on your system. So you can run such command in Background or simultaneously by giving command like Background process $ ls / -R | wc -l & The ampersand ( & ) at the end of command tells shells start process ( ls / -R | wc -l ) and run it in background takes next command immediately. Process & PID " An instance of running command is called process and the number printed by shell is called process-id (PID) , this PID can be use to refer specific running process. " Linux Command Related with Process To see currently running process ps $ ps To stop any process by PID i.e. to kill process kill {PID} $ kill 1012 To stop processes by name i.e. to kill process killall {Process-name} $ killall httpd To get information about all running process ps -ag $ ps -ag To stop all process except your shell kill 0 $ kill 0 For background processing (With &, use to put particular command and program in background) linux-command & $ ls / -R | wc -l & To display the owner of the processes along with the processes ps aux $ ps aux To see if a particular process is running or not. For this purpose you have to use ps command in combination with the grep command ps ax | grep process-U- want-to see For e.g. you want to see whether Apache web server process is running or not then give command $ ps ax | grep httpd To see currently running processes and other information like memory and CPU usage with real time updates. top $ top Note that to exit from top command press q. To display a tree of processes pstree $ pstree Note you can only kill process which are created by yourself. A Administrator can almost kill 95-98% process. But some process can not be killed, such as VDU Process. Turning foreground process into the background For example you have a process $ls To turn this into a background process, first press Ctrl+z to suspend the process Ctrl + z [1]+ Stopped ls $ bg 1 RETURNING A PROCESS TO THE FOREGROUND $ fg 1 If you forget the process numbers, use jobs command. The jobs command...
View Full Document

This note was uploaded on 07/15/2011 for the course ECO 2023 taught by Professor Mr.raza during the Summer '10 term at FAU.

Page1 / 51

What Linux is and shell script with process - Processes...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online