Commands by theneb (1)

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

Shows cpu load in percent
This version is precise and requires one second to collect statistics. Check sample output for a more generic version and also a remote computer invocation variant. It doesn't work with the busybox version of the 'top' command but can be adjusted

Download schedule
Downloads at 12:00

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)

archlinux: shows list of files installed by a package
Shows the files which the package, for example gvim, installed on your system.

list all opened ports on host
in loop, until the last port (65535), list all opened ports on host. in the sample I used localhost, but you can replace with any host to test.

Backup all MySQL Databases to individual files

Pipe stdout and stderr, etc., to separate commands
You can use [n]> combined with >(cmd) to attach the various output file descriptors to be the input of different commands.

paste one file at a time instead of in parallel
paste one file at a time instead of in parallel

copy working directory and compress it on-the-fly while showing progress
What happens here is we tell tar to create "-c" an archive of all files in current dir "." (recursively) and output the data to stdout "-f -". Next we specify the size "-s" to pv of all files in current dir. The "du -sb . | awk ?{print $1}?" returns number of bytes in current dir, and it gets fed as "-s" parameter to pv. Next we gzip the whole content and output the result to out.tgz file. This way "pv" knows how much data is still left to be processed and shows us that it will take yet another 4 mins 49 secs to finish. Credit: Peteris Krumins http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

check open ports without netstat or lsof


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: