I like to make it an alias in my .bashrc file, as such: alias psme='ps -ef | grep $USER' Show Sample Output
sh as: #! /bin/sh while [ 1 -ne 6 ]; do pid=`ps -ef | grep -v "grep" | grep "trans_gzdy" | cut -c10-17` ps gv $pid | head -2 sleep 1 done check changes of RSS. Show Sample Output
My variant on this common function. Some highlights: Allows you to override the default ps args of "aux" Uses bracket trick to omit the grep process itself without having to use a second grep Always prints the correct header row of ps output Limitations: Ugly ps error output if you forget to quote your multi word grep argument Show Sample Output
Adds up the total memory used by all Stainless processes: 1 Stainless, 1 StainlessManager and 1 StainlessClient per tab open. Show Sample Output
If you're on a system that doesn't have nl, you can use cat -n.
This command will show you amount of memory used by apache Show Sample Output
Can use lsof, but since it's not part of the base OS, it's not always available. Show Sample Output
My old Solaris server does not have lsof, so I have to use pfiles.
A way not so simple but functional for print the command for the process that's listening a specific port.
I got the pid from lsof because I think it's more portable but can be used netstat
netstat -tlnp
Show Sample Output
Col 1 is swapped sum in kb Col 2 is pid of process Col 3 is command that was issued Show Sample Output
Kills all process that belongs to the user that runs it - excluding bash, sshd (so putty/ssh session will be spared). The bit that says grep -vE "..." can be extended to include ps line patterns that you want to spare. If no process can be found on the hitlist, it will print # NOTHING TO KILL. Otherwise, it will print # KILL EM ALL, with the cull list.
Using ps options rather than filtering. Show Sample Output
First version was "ps uw -p $$", but current "ps -o comm= -p $$" just gives shell name
Pros: the format is very simple, there is no need to show every columns, and full command with args the first column is memory consumption % the second column is pid the third is just the command (without full arguments, most application's arguments are too long) You can decide which application to kill then. Show Sample Output
Outputs the PID of any given file run from a command line... Hope it helps!
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs Show Sample Output
Use ps instead of top. But do not use BSD options at all, they are confusing. Use "s=" or "state=" to show consice process statuses. Show Sample Output
to be executed from root. this works well on most commercial unix systems, have not tried on linux systems.
Gets the current system user running a process with the specified pid 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: