Commands using mv (211)

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

Copy a directory recursively without data/files

clone an USB stick using dd + see its process
The following command will clone usb stick inside /dev/sdc to /dev/sdd Double check you got the correct usb sticks (origional-clone)with fdisk -l.

List files older than one year, exluding those in the .snapshot directory
Useful when you want to cron a daily deletion task in order to keep files not older than one year. The command excludes .snapshot directory to prevent backup deletion. One can append -delete to this command to delete the files : $ find /path/to/directory -not \( -name .snapshot -prune \) -type f -mtime +365 -delete

return external ip
curl ->\n curl -> curl -> JSON print curl -> JSON pretty print curl -> YAML format curl -> TOML format

ls not pattern
Negative shell globs already come with bash. Make sure to turn on extended pattern matching with 'shopt -e extglob'.

Clear all Windows Event Log entries (cygwin)
Efficiently clear all Windows Event log entries from within a Cygwin terminal. Uses "cygstart" to launch a hidden "PowerShell" session passing a Powershell command to loop through and clear all Windows Event Log entries. Very useful for troubleshooting and debugging. The command should in theory elevate you session if needed. One liner is based on the PowerShell command: $ wevtutil el | foreach { wevtutil cl $_ }

extract all urls from firefox sessionstore
This will extract all of the urls from a firefox session (including urls in a tab's history). The sessionstore.js file is in ~/.mozilla/firefox/{firefox profile}

Delete an IPtable rules based on row number

Averaging columns of numbers
This example calculates the averages of column one and column two of "file.dat". It can be easily modified if other columns are to be averaged.

zgrep across multiple files

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: