Use if you have pictures all over the place and you want to copy them to a central location Synopsis: Find jpg files translate all file names to lowercase backup existing, don't overwrite, preserve mode ownership and timestamps copy to a central location
Provides numerically sorted human readable du output. I so wish there was just a du flag for this. Show Sample Output
You'll need "feh" to set the background from the commandline. Install with "apt-get install feh" Thanks to the Redditors on this thread: http://www.reddit.com/r/linux/comments/bira4/is_there_a_linux_version_of_this_preferably_a/
This will remove all installed kernels on your debian based install, except the one you're currently using. From: http://tuxtweaks.com/2009/12/remove-old-kernels-in-ubuntu/comment-page-1/#comment-1590
This one-liner will output installed packages sorted by size in Kilobytes. Show Sample Output
Renames all files in a directory named foo to bar. foobar1 gets renamed to barbar1 barfoo2 gets renamed to barbar2 fooobarfoo gets renamed to barobarfoo NOTE: Will break for files with spaces AND new lines AND for an empty expansion of the glob '*'
When working with jailed environments you need to copy all the shared libraries to your jail environment. This is done by running ldd on a binary which needs to run inside the jail. This command will use the output from ldd to automatically copy the shared libraries to a folder of your choice. Show Sample Output
-r recursively -Z zero byte after each file name instead of the usual newline -l only filenames
-Qdt Lists dependencies/packages which are no longer required by any packages -q Output only package name (not the version number) -R Remove package(s) Rest is self-explanatory. I just started out with Arch - so if there is any better/standard method to achieve the same - please suggest.
Convert some SVG files into PNG using ImageMagick's convert command. Run the conversions in parallel to save time. This is safer than robinro's forkbomb approach :-) xargs runs four processes at a time -P4
This will show all changes in all log files under /var/log/ that are regular files and don't end with `gz` nor with a number Show Sample Output
if you want to move with command mv large list of files than you would get following error /bin/mv: Argument list too long alternavite with exec: find /source/directory -mindepth 1 -maxdepth 1 -name '*' -exec mv {} /target/directory \; Show Sample Output
Seq allows you to define printf like formating by specified with -f, %03g is actually tells seq I got three digits, fill the blank digits with 0, and the range is from 176 to 240.
Counts number of lines of code in *.h and *.cc files
This is a 'killall' command equivalent where it is not available. Prior to executing it, set the environment variable USERNAME to the username, whose processes you want to kill or replace the username with the $USERNAME on the command above. Side effect: If any processes from other users, are running with a parameter of $USERNAME, they will be killed as well (assuming you are running this as root user) [-9] in square brackets at the end of the command is optional and strongly suggested to be your last resort. I do not like to use it as the killed process leaves a lot of mess behind.
I use this to generate a playlist with all the podcasts I listen to. Ordered from most recent to older. Show Sample Output
You also can sum the file usage of all files
find /usr/lib -maxdepth 1 -type l -print0 | xargs -r0 du -Lch
This will get the job done in the most efficient way -
spawning only one `rm` process.
"On-the-fly" find data is displayed through `tee` and
you should have plenty of time to ctrl-c if needed before it's too late.
You may need to re-run this after major Software Updates.
To leave more languages in, add more ``-and \! -iname "lang*"'' statements:
sudo find / -iname "*.lproj" -and \! -iname "en*" -and \! -iname "spanish*" -print0 | tee /dev/stderr | sudo xargs -0 rm -rfv
**Edit: note the 2nd sudo near the end of the pipeline - this is necessary.
Create backup (.tar.gz) for all first-level directory from current dir. Show Sample Output
If you're like me and want to keep all your music rated, and you use xmms2, you might like this command. I takes 10 random songs from your xmms2 library that don't have any rating, and adds them to your current playlist. You can then rate them in another xmms2 client that supports rating (I like kuechenstation). I'm pretty sure there's a better way to do the grep ... | sed ... part, probably with awk, but I don't know awk, so I'd welcome any suggestions. Show Sample Output
Note that this assumes the application is an SVN checkout and so we have to throw away all the .svn files before making the substitution.
added alias in ~/.bashrc alias lf='find ./* -ctime -1 | xargs ls -ltr --color' 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: