The other 2 commands that are listed will also kill the egrep process and any libexec processes because the .exe isn't escaped so it is really using . meaning anything containing exe. The command i posted escapes the (dot) in .exe and then filters the actual egrep process so that it doesn't get killed before the other processes being killed. Also added the -9 switch for kill to send sigterm to the processes, in case people are wondering why processes aren't getting killed after running just kill . This should work better for people :)
To distinguish normal users from system users. Specify an UID, to list all all users with UID bigger than that in /etc/passwd.
Save as a bash script and run as root to set the ondemand cpu frequency governor for all cpu cores. Name the file ondemand. Change 'ondemand' in the argument to performance or your preferred governor to do the same thing but set all cpu cores to use the performance governor (or your preferred governor)
Mounts a disk-image of a hdd with partitions
Often you want to nmap a list of IPs using the -iL flag. This is an easy way to generate a list of IPs that are online in a specific subnet or IP range (192.168.1.100-110). Show Sample Output
Tested in bash on AIX & Linux, used for WAS versions 6.0 & up. Sorts by node name. Useful when you have vertically-stacked instances of WAS/Portal. Cuts out all the classpath/optional parameter clutter that makes a simple "ps -ef | grep java" so difficult to sort through. Show Sample Output
This will extract the differing CSS entries of two files. I've left the initial character (plus or space) in output to show the real differing line, remove the initial character to get a working CSS file. The output CSS file is usable by either adding it in a below the to original.css, or by only using the output but adding @import url("original.css"); in the beginning. This is very useful for converting Wordpress theme copies into real Wordpress child themes. Could exclude common lines within entries too, I guess, but that might not be worth the complexity. Show Sample Output
Detect duplicate UID in you /etc/passwd (or GID in /etc/group file). Duplicate UID is often forbidden for it can be a security breach. Show Sample Output
This command displays the CPU idle + used time using stats from /proc/stat. Show Sample Output
This command does a basic find with size. It also improves the printout given (more clearer then default) Adjusting the ./ will alter the path. Adjusting the "-size +100000k" will specify the size to search for. Show Sample Output
If you are installing some new package. You can first go through the step by step install and then take the commands that you ran from history to create shell script which can used to install the package on other machines say test or production.
This is also perl-less, and only uses AWK as its postprocessor. Tested with GAWK and MAWK.
Kill all process that concide whit PATTERN Show Sample Output
It remove the square bracket and convert UNIX time to human readable time for all line of a stream (or file). Show Sample Output
See who is using a specific port. Especially when you're using AIX. In Ubuntu, for example, this can easily be seen with the netstat command. Show Sample Output
This is actually quite slow~ P.S. change `seq 2 100` to `seq 2 1000` and try Show Sample Output
handels @, ?, whitespaces in names. replace "?" and "add" by "!" and "rm" for svn mass remove. ---> I m looking for a nicer way to write it, perhaps with something using " perl -ne '`blahblah` if /\?(.*)/' " Show Sample Output
This is great when you need to reboot the system-server, or your own daemon that has gone crazy
This will save parsing time for operations on very big files.
EG: aspectRatio 1920 1200
For display a image in full screen it should be in any of the resolution obtained from the output. So resize an image to any of it and you can display it in full screen
For general aspect ratio :
aspectRatio () { for i in `seq 1 1000 `; do awk "BEGIN {print $1/$i, $2/$i}"; done |grep -v "\." |tail -1; }
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: