commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
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".