Commands using ssh (347)

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

Count threads of a jvm process
if you have problem threads problem in tomcat

Copy via tar pipe while preserving file permissions (run this command as root!)
It's the same like 'cp -p' if available. It's faster over networks than scp. If you have to copy gigs of data you could also use netcat and the tar -z option in conjunction -- on the receiving end do: # nc -l 7000 | tar -xzvpf - ...and on the sending end do: # tar -czf - * | nc otherhost 7000

Get the Volume labels all bitlocker volumes had before being encrypted
Get information of volume labels of bitlocker volumes, even if they are encrypted and locked (no access to filesystem, no password provided). Note that the volume labels can have spaces, but only if you name then before encryption. Renaming a bitlocker partition after being encrypted does not have the same effect as doing it before.

Simple complete system backup excluding files or directories
You can exclude more system folders or individual files which are not necessary for the backup and can be recreated after the restore procedure, like /lost+found, /mnt, /media, /tmp, /usr ... Restoring the above backup procedure is as simple as becoming root and typing: $ tar zxpf backup.tgz -C / You can extract any file or directory out of the backup.tgz file for recovery, for instance, if you have a corrupt or mis-configured fstab file, you could simply issue the command: $ tar zxpf backup.tgz /ect/fstab -C / Other options: v add verbose option to see files processed A far safer solution is to restore the desired files under a different directory, and then compare, move, or update the files to their original locations afterward.

Your name backwards

Get disk quota usage openvz using vzlist
OpenVZ: Get disk quota usage for your VEID

Creates a SSHFS volume on MacOS X (better used as an alias). Needs FuseFS and SSHFS (obvioulsly).
To make it even more practical, make sure you can login to the ssh server using a keypair.

Copy 3 files from 3 different servers and adds server name tag to file copied

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 the package that installed a command


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: