Commands by phribbr (1)

  • Copy files and dir in parallel. It is Faster. Using the gnu-parallel. Has 2 commands: - First - Create dir structure in /BKP find Files/ -type d | parallel 'mkdir -p /BKP/{}' - Second - Copy for structure created find Files/ -type f | parallel 'rsync -a {} /BKP/$(dirname {})' - Great for backups! - Can use "rsync" or "cp". - Compare with a simple "rsync" or "cp"!

    find Files/ -type d | parallel 'mkdir -p /BKP/{}' && find Files/ -type f | parallel 'rsync -a {} MKD/$(dirname {})'
    phribbr · 2012-08-08 21:01:37 0

What's this? 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.

Share Your Commands

Check These Out

Touch a file using a timestamp embedded in the file name.
tstouch takes two arguments: a filename containing a timestamp, and an extended regular expression with the parenthesized section matching a timestamp of the form YYYYMMDDhhmm or It then touches the file with that timestamp.

mail with attachment
An easy one but nice to keep in mind.

Does a full update and cleaning in one line

Python extract json

Find all folder in /var that contains log in their path and have more than 10 files inside them, print the folder and the count
-L is for following symbolic links, it can be omitted and then you can find in your whole / dir

Rename files in batch

Get AWS temporary credentials ready to export based on a MFA virtual appliance
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token. This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use: `awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'` You must adapt the command line to include: * $MFA_IDis ARN of the virtual MFA or serial number of the physical one * TTL for the credentials

Show Shared Library Mappings
shows which shared lib files are pointed to by the dynamic linker.

Takes an html file and outputs plain text from it

Create a new file

Stay in the loop…

Follow the Tweets.

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.


Subscribe to the feeds.

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: