without reverse...
find files recursively from the current directory, and list the extensions of files uniquely Show Sample Output
count & sort one field of the log files , such as nginx/apache access log files .
Lists the size in human readable form and lists the top 25 biggest directories/files
A lot of files in one dir is not so cool for filesystem.
Kind of fun if you're that was inclined. I figured most of my commands start with s. sudo, screen, ssh etc. This script tells me what else they start with. Show Sample Output
This is a modified version of the OP, wrapped into a bash function. This version handles newlines and other whitespace correctly, the original has problems with the thankfully rare case of newlines in the file names. It also allows checking an arbitrary number of directories against each other, which is nice when the directories that you think might have duplicates don't have a convenient common ancestor directory.
I used to do this sorting with:
sort file.txt | uniq -c | sort -nr
But this would cause the line (2nd column) to be sorted in descending (reverse) order as well sa the 1st column. So this will ensure the 2nd column is in ascending alphabetical order.
Show Sample Output
Avoids the nested 'find' commands but doesn't seem to run any faster than syssyphus's solution.
The original command doesn't work for me - does something weird with sed (-r) and xargs (-i) with underscores all over... This one works in OSX Lion. I haven't tested it anywhere else, but if you have bash, gpg and perl, it should work. Show Sample Output
If you have GNU findutils, you can get only the file name with
find /some/path -type f -printf '%f\n'
instead of
find /some/path -type f | gawk -F/ '{print $NF}'
Show Sample Output
The number on the far right is ratio of comments to code, expressed as a percentage. For the rest of the Yardstick documentation see https://github.com/calmh/yardstick/blob/master/README.md#reported-metrics Show Sample Output
top 10 of access log
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: