All commands (14,187)

What's this?

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.

Share Your Commands


Check These Out

Convert diff output to HTML ins/del

Create a persistent connection to a machine
Create a persistent SSH connection to the host in the background. Combine this with settings in your ~/.ssh/config: Host host ControlPath ~/.ssh/master-%r@%h:%p ControlMaster no All the SSH connections to the machine will then go through the persisten SSH socket. This is very useful if you are using SSH to synchronize files (using rsync/sftp/cvs/svn) on a regular basis because it won't create a new socket each time to open an ssh connection.

Exiftool adjust Date & Time of pictures
Change the original date set by camera : Create Date : 2020:08:21 13:26:24.63 //Operating System: Date Created (ie: sdcard) Date/Time Original : 2020:08:21 13:26:24.63 // Set by camrea when you point and click for photo Modify Date : 2020:08:21 13:26:24.63 //Operating System: Modified (ie: sdcard) Exif argument examples are : exiftool.exe ā€œ-DateTimeOriginal+=0:0:0 5:30:0ā€ filename.jpg (add 5 hours and 30 minutes to the Exif Date/Time Original) exiftool.exe" "-modifydate-=0:0:0 0:25:0" filename.jpg (reduce the Exif Modify Date to 25 minutes) exiftool.exe ā€œ-AllDates+=Y:M:D h:m:sā€ filename.jpg (Change all exif date values to Y:M:D h:m:s)

Update twitter via curl

dump a single table of a database to file

Find unused IPs on a given subnet

print date 24 hours ago

Get your local IP regardless of your network interface
Shows only IP-addresses of ifconfig except 127.0.0.0/8. I fixed the script to work on more systems and configs short info /inet/!d; #grep inet /127.0/d; # grep -v 127.0 /dr:\s/d; # grep -v dr: s/^.*:\(.*\)B.*$/\1/ # remove everything exept between : and B

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

Explanation of system and MySQL error codes
perror should be installed if mysql-server package is installed


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: