This doesn't require any non-standard programs.
Sometimes you want to see all of the systcls for a given $thing. I happened to need to easily look at all of the vm sysctls between two boxes and compare them. This is what I came up with. Show Sample Output
Shows sorted by query time, the headers of mysqlbinlog entries. Then is easy to locate the heavier events on the raw log dump Show Sample Output
Watch out if you have several USB drives plugged in: it scans the whole /media/ folder !!! You can replace /media/ by the path of a specific USB drive (something like /media/F77A-530B/) I use a sound recorder and I want to plug the recorder and grab the most recent sound. That's what this command does. Use mv instead of cp to move instead of copy. Change *.wav to the required file type.
This will list all installed packages on a RedHat/CentOS based system, sort them alphabetically, Parse off the version numbers, and delete any duplicate entries. This is good if you need to build out a mirrored system or rebuild a failing system. Show Sample Output
M is size in megabytes, man expac to see other sizes %m is install size %k is download size
here's a version which works on OS X.
"nl -ba" numbers all lines in the file (including empty lines), "sort -nr" sorts the lines in descending order, and the "cut" command finally removes the line numbers again.
cut -f1,2 - IP range 16 cut -f1,2,3 - IP range 24 cut -f1,2,3,4 - IP range 24 Show Sample Output
Sort using kth column using : delimiter
ls -al gives all files, sort +4n sorts by 5th field numerically
Uniq command is mostly used in combination with sort command, as uniq removes duplicates only from a sorted file. i.e In order for uniq to work, all the duplicate entries should be in the adjacent lines. Show Sample Output
The following displays only the entries that are duplicates. Show Sample Output
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. When i saw the command i had some ideas to make it shorter. Here is my version.
"-exec" ftw.
Get link to external sites of a url Show Sample Output
The command will make it easy to determine free IP ranges in a crowded sub-net. Show Sample Output
This command will find the highest context switches on a server and give you the process listing. Show Sample Output
This probably only works without modifications in RHEL/CentOS/Fedora. Show Sample Output
the -h option of du and sort (on appropriate distrib) makes output "Human" readable and still sorted by "reversed size" (sort -rh) Show Sample Output
Searches for *.cpp and *.h in directory structure, counts the number of lines for each matching file and adds the counts together. 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: