Commands by Mozai (12)

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 CSV to JSON
Replace 'csv_file.csv' with your filename.

Make ISO image of a folder
Create ISO image of a folder in Linux. You can assign label to ISO image and mount correctly with -allow-lowercase option.

Remove all files but one starting with a letter(s)
Remove everything in current directory except files starting with "ca".

vim insert current filename
insert filename Normal mode: "%p Insert mode: %

Rescan partitions on a SCSI device
Used this after cloning a disk with dd to make the newly written partitions show up in /dev/

Get length of current playlist in xmms2

List every file that has ever existed in a git repository
What was the name of that module we wrote and deleted about 3 months ago? windowing-something? $ git log --all --pretty=format:" " --name-only | sort -u | grep -i window

See entire packet payload using tcpdump.
This command will show you the entire payload of a packet. The final "s" increases the snaplength, grabbing the whole packet.

Rename files in batch

take a look to command before action
add |sh when you agree the list, I often use that method to prevent typos in dangerous or long operations


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: