Search for java explicit incrementation in order to replace it with postfix or assignment operator Show Sample Output
Returns last day of current month. Useful to implement a bash script backup based on a GFS strategy. 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.
Depending on your Apache access log configuration you may have to change the sum+=$11 to previous or next awk token. Beware, usually in access log last token is time of response in microseconds, penultimate token is size of response in bytes. You may use this command line to calculate sum and average of responses sizes. You can also refine the egrep regexp to match specific HTTP requests. Show Sample Output
Get link to external sites of a url Show Sample Output
looks at html for "ip" (it's a CSS class), then a little of cut and egrep to get IPv4 address. I use this oneliner into conky. Show Sample Output
find files recursively from the current directory, and list the extensions of files uniquely Show Sample Output
This one has a better performance, as it is a one pass count with awk. For this script it might not matter, but for others it is a good optiomization.
I used this to get all the remote connection ip addresses connected to my server... I had to start storing and tracking this data so thats why i built this out... probably not optimal as far as the egrep regex but it works ;) Show Sample Output
This will strip out the relivent disk information from kvm. I'm using it to find disks on a SAN which are no longer in use. Show Sample Output
Filter entries in OpenSuse /var/log/messages like: timestamp servername kernel: [83242.108090] btrfs: checksum error at logical 1592344576 on dev /dev/sda5, sector 5223584, root 5, inode 2652, offset 282624, length 4096, links 1 (path: log/warn) Show Sample Output
A grep against ethtool to look for common errors and packet loss statistics which network drivers report in their private data, which is queried with ethool -S. This is the current grep used in xsos (https://github.com/ryran/xsos), which I originally contributed and has been improved by the community over time. Show Sample Output
Thx Mass1 for the sharing
Its possible to user a simple regex to extract de username from the finger command. The final echo its optional, just for remove the initial space Show Sample Output
Using egrep to search multiple patterns. Show Sample Output
To check the total number of mounts, maximum number of mounts before performing the fsck and last time when the fsck was performed. 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: