There are times that we execute and let our scripts and/or applications to be executed from the current session inside linux terminal while doing another work. Sometimes we gave them varied process priorities as well no to interfere with other box operations and process. This is also helpful specially to those linux boxes managed by several root sysadmins. Tnis can also be executed from non-root user linux acount.
Here's how to list down and display all currently running jobs from the current session?
First, let us simulate a linux command to run in the background as shown below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# updatedb &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The & character tells the linux to execute to the background process, thus leaving a currently running job from the currently logged in user.
Now, here's how to list down a currently running jobs from your current session. Simply
# jobs
Result:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1]+ Running updatedb &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Another example.
Let's leave the find command to run into the background process like so
Run find into the background
# find /usr -name *.ver &
Check the running jobs from the background
# jobs
[1]+ Running find /usr -name *.ver &
Display PIDS of the running jobs in the background
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# jobs -p
11999
# jobs -l
[1]+ 11999 Running find /usr -name *.ver &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ofcourse, using the linux 'ps' terminal command would also list down the job, with combination of grep filtering command as shown below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ps axuw | grep find
root 11999 3.3 0.1 5088 1840 pts/4 D 13:42 0:00 find /usr -name *.ver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are more linux command on manipulating, moving, pausing and stopping a currently running linux job from current session.
Related:
To list out user's cron jobs, check here.
To read more cron job scheduling usage and samples, view it here.
HTH
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
November
(39)
- HowTo: Strip directory path and filename suffix
- HowTo: Get the Filename Extension Only
- Tailf - watch the linux log file grows
- Fedora 8 with Enlightenment Window Manager
- HowTo: ScreenCasts & Desktop Records via Istanbul
- HowTo: Record Desktop Session via Byzanz
- Linux Scorched 3D Tank Game
- Linux Atomic Battle Tank Game
- HowTo: Display a Tree of Linux Processes
- Howto: 3 Easy Install Steps of Microsoft Fonts in ...
- Howto: Convert PDF to HTML/XML/PNG in Linux
- Livna Repository on Fedora 8
- Linux Action Flight Simulator Game
- Splitting and Merging Multiple Linux Files
- Sort Nth Position of Nth Column of a File in Linux
- Stop, Pause, and Continue A Linux Process
- File Creation without File Opening in Linux
- Concatenate Multiple Files in Linux
- Renaming Files in Linux
- Linux Power Consumption Analysis Tool
- Tail and Head Few Lines of Text Files
- Three Easy Steps for Opera on Fedora 8
- Alternative Search and Replace Tool
- Display Lines Beginning with a Given String
- Spell Check Files via Terminal - Install Howto
- Display Linux Session Jobs
- Get Linux Disk Space and Usage
- Change Linux RunLevels Howto
- Audacious - Install Howto
- Amarok - Howto Install
- Sun Java on Fedora 8 Install HowTo
- My Fedora 8 Diary
- Chikka on Kopete Messenger Howto
- Linux Files and Folders Local Copying
- Linux folders and directories recursive removal
- MailX - Mail Facility via Terminal
- Time zone values interpretation
- Retrieving Linux Standard Base and Distro Information
- Fedora Firstboot
-
▼
November
(39)
Tuesday, November 20, 2007
Display Linux Session Jobs
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment