Top 10 Memory Processes (reduced output to applications and %usage only) Show Sample Output
Kill all processes with foo in them. Similar to pkill but more complete and also works when there is no pkill command. Works on almost every Linux/Unix platform I have tried.
8~osstat, $2~pid, $11~cmd
Yet another ps grep function, but this one includes the column headings. Show Sample Output
It's like `prstat -t` under Solaris Show Sample Output
This does the same thing as many of the 'grep' based alternatives but allows a more finite control over the output. For example if you only wanted the process ID you could change the command:
ps -ef | awk '/mingetty/ && !/awk/ {print $2}'
If you wanted to kill the returned PID's:
ps -ef | awk '/mingetty/ && !/awk/ {print $2}' | xargs -i kill {}
Show Sample Output
Add that and "cont () { ps -ec | grep $@ | kill -SIGCONT `awk '{print $1}'`; }" (without the quotes) to you bash profile and then use it to pause and resume processes safely
By setting the UNIX95 variable in HP-UX the XPG4 mode is activated, you get new options for ps and other commands, for me the best way to use this is to create an alias named ptree in root profile: alias ptree='UNIX95=1 ps -eH'
This is different that `who` in that who only cares about logged-in users running shells, this command will show all daemon users and what not; also users logged in remotely via SSH but are running SFTP/SCP only and not a shell. Show Sample Output
if you have problem threads problem in tomcat
get a list of currently running oracle dbs (identified by the pmon process) show the executable that spawned the process and show the ORACLE_HOME relative to the environment within which the process is running tailored to AIX (sed on linux behaves...differently) suggestions for a better way...please.
Nicely display mem usage with ps. Show Sample Output
Simpler.
This command will list all threads started by a particular pid along with the start time of each thread. This is very valuable when diagnosing thread leaks.
mac os x: ps aux | awk '{print($1" "$3" "$4" "$11);}' | grep -v "0,0" linux: ps aux | awk '{print($1" "$3" "$4" "$11);}' | grep -v "0.0" Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: