How can I kill Linux processes older than a certain age?
ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 7200 308 ? Ss Jun22 0:02 init [5]
root 2 0.0 0.0 0 0 ? S Jun22 0:02 [migration/0]
root 3 0.0 0.0 0 0 ? SN Jun22 0:18 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S Jun22 0:00 [watchdog/0]
stat /proc/<pid>
ohm ~$ stat /proc/1
File: `/proc/1"
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 3h/3d Inode: 65538 Links: 5
Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-06-22 15:37:44.347627750 -0700
Modify: 2008-06-22 15:37:44.347627750 -0700
Change: 2008-06-22 15:37:44.347627750 -0700
Source: By yukondude as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 3.0
Related code-snippets:
- How can I get the value of in a loop?
- Is gettimeofday() guaranteed to be of microsecond resolution?
- What is error log per Virtual Host?
- What's the API for GTK messagebox?
- How do I get root permission for my file inside vi?
- Windows Equivalent of 'nice'.
- Can I use Xming X Window Server over a VPN?
- How can I fix the Java Time Zone?
- Date arithmetic in Unix shell scripts.
- What's a quicker way to find duplicates conditioned by time?
- How do I encode XML files to XFS,?
- How do I show a GUI message box in Linux?
- How can I setup public key authentication?
- How to avoid redefining VERSION, PACKAGE, etc. How to avoid redefining VERSION, PACKAGE, etc.?
- How can we resolve symbolic links in a shell script?