commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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
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:
?Cat and grep? You can use only grep ("grep \. filename"). Better option is awk.
Using DynDNS or a similar service not only allows access to your home machine from outside without needing to know what IP the ISP has assigned to it but it also comes in handy if you want to know your external IP address. The only purpose of the sed command is to remove the leading "host.na.me has address " part from the output. If you don't need to discard it you can simply use
host $HOSTNAME
On Ubuntu, if tzwatch is installed, then you can call up in terminal the output for every time zone configured in gWorldClock.
On Ubuntu, if tzwatch is installed, then you can call up in terminal the output for every time zone configured in gWorldClock.
prints out the time for the timezone specified in $offsetutc. So you have less to think about things like: "I'm in utc+4 and my friend in utc-7, can I call him now or will I wake him?"
Note: $offsetutc should be an integer between -12 and 12.
sends commands specified in $commandfile to the telnet-server specified by $telnetserver.
to have newlines in $commandfile interpreted as ENTER, save the file in CR+LF (aka "Windows-Textfile") format.
if you want to save the output in a separate file, use:
nc $telnetserver 23 < $commandfile > $resultfile
extracts the debian-package $debfile to $extractdir, including all packaging-information. to repack the package, just type:
dpkg-deb -b $extractdir
I use this in a script on my openwrt router to check if my DynDNS needs to be updated, saves your account from being banned for blank updates.
Same as original just no $ at start
Strips the non-ip information from the dig output. Could be combined with "head -1" to ensure a single ip is returned. Useful for outputting as a variable for use in scripts.
A similar command that lists only the currently running VMs is thus:
VBoxManage list runningvms
...the above showing a list of VMs by name and UUID in the same format as the "$ VBoxManage list vms" command
you can launch a VirtualBox VM from the command line using VBoxManage, but that invokes it in a gui environment.
If you want to just fire off your VM in the background, use VBoxHeadless as shown. To get the names and UUIDs of your VirtualBox VMs, type:
VBoxManage list
Gets the internal and external IP addresses of all your interfaces, or the ones given as arguments
Generates password consisting of alphanumeric characters, defaults to 16 characters unless argument given.
-n 9000 : Number of requests to perform for the benchmarking session
-c 900 : Number of multiple requests to perform at a time
Uses the last argument of the last executed command, and gets the directory name from it.
Use $!:t for the filename alone, without the dirname.