commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
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
Caution: distructive overwrite of filenames
Useful for concatenating pdfs in date order using pdftk
Downloads a CRL file, determines the expiration time, and checks when it will expire
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
It requires https://jqplay.org/, that comes with brew: brew install jq
bash brace expansion, sequence expression
Use case insensitive regex to match files ending in popular video format extensions and calculate their total time. (traverses all files recursively starting from the current directory)
Find all files in SVN workspace directories which are uncommitted. List them and find their properties
Works even with spaces in filenames.
As an alias in .gitconfig:
editchanged = "!git status --porcelain | sed -ne 's/^ M //p' | tr '\\n' '\\0' | tr -d '\"' | xargs -0 vim"
Tired of front end developers using short open tags in your views? This will replace all instances of
Many tasks need mac id check. above command exactly do the same
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
After this command you can review doit.sh file before executing it.
If it looks good, execute: `. doit.sh`
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes. The files may need to be deleted and replaced with backups.
shows you the symlinks in the current directory, recursively, but without following them
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes.
xargs will automatically determine how namy args are too many and only pass a reasonable number of them at a time. In the example, 500,002 file names were split across 26 instantiations of the command "echo".