centos list directories sorted by size Show Sample Output
for filename multilingual (ex.japanese, chinese, ...etc)
display IP's that unsuccessfully attempted to login 5 or more times today may want to filter any trusted IP's and the localhost useful for obtaining a list IP addresses to block on the firewall Show Sample Output
Other solutions that involve doing
du -sx /*
are incomplete because they will still descend other top-level filesystems are that mounted directly at "/" because the * expands to explicitly include all files and directories in "/", and du will still traverse them even with -x because you asked it to by supplying the directory name as a parameter (indirectly via "*").
Show Sample Output
The description of how the one-liner works is here at my blog: http://jugad2.blogspot.com/2008/09/unix-one-liner-to-kill-hanging-firefox.html Show Sample Output
For quick validation of folder's file-contents (structure not taken into account) - I use it mostly to check if two folders' contents are the same. Show Sample Output
Useful to check DDoS attacks on servers. Show Sample Output
Searches /var/log/secure for smtp connections then lists these by number of connections made and hosts.
If a directory name contains space xargs will do the wrong thing. Parallel https://savannah.nongnu.org/projects/parallel/ deals better with that. Show Sample Output
Here's a version that doesn't use find.
Finds all files below the current directory. Orders the result from smallest to largest. Good for finding the largest files in the tree.
We normally get tasks in which one has to sort a data file according to some column. For a single file say foo, we would use sort -k 3 foo >tmp && tmp foo The for loop is useful when we have to do it on a number of files.
A space-padded version:
perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;'
This command lists all the directories in SEARCHPATH by size, displaying their size in a human readable format. Show Sample Output
PmWiki stores wiki pages as Group.Name. Simply split the directory listing and count frequency of group occurances. Show Sample Output
If both file1 and file2 are already sorted: comm -13 file1 file2 > file-new
Seeing that _sort_ its been used, why not just _use_ it. ;) Show Sample Output
I make an extensive use of sudo, so I had to exclude the sudo part of the command history
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: