Commands by ivanatora (13)

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

Mount a VMware virtual disk (.vmdk) file on a Linux box
Assumes XP/2000/2003. For Server 2008+ try offset=105,906,176 You can find this number in the System Information utility under Partition Starting Offset. UEFI based boxes you want partition 2 since the first is just the boot files (and FAT). This works with (storage side) snapshots which is handy for single file restores on NFS mounted VMware systems

Convert JSON to YAML
Requires installing json2yaml via npm: npm install -g json2yaml (can also pipe from stdin) Ref: https://www.npmjs.com/package/json2yaml

duration of the DNS-query

list block devices
Shows all block devices in a tree with descruptions of what they are.

makes screen your default shell without breaking SCP or SFTP
I changed my shell to screen by editing .bashrc, this stopped scp from connecting. Adding two tests before screen fixed them problem.

Deleting / Ignoring lines from the top of a file
Output lines starting at line 2.

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Find all files with colons and replace with underscores; current directory and below (recursive).

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Make alias pemanent fast
Simple function to permanently add an alias to your profile. Tested on bash and Ksh, bash version above. Here is the ksh version: PERMA () { print "$@" >> ~/.profile; } Sample usage: PERMA alias la='ls -a'


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: