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:
command creates a pool with two mirrors, where each mirror contains two disks.
Instead of tedious manual mv commands and tabbing, this routine creates a file listing all the filenames in the PWD twice, edit the second instance on each line to the new name, then save the file, the routine does the rest. Feel free to replace nano with your holy war editor of choice.
You will get a lot of "mv: 'x' and 'x' are the same file" warnings, these could be cleaned up but the routine works.
First use find to find all the images that end with jpg or JPG in the current dir and all its children.
Then pipe that to xargs. The -I{} makes it so spaces in filenames don't matter.
The 1024">" makes it so it takes any image greater in dimension than 1024 and resizes them to 1024 width, but keeping aspect ratio on height.
Then it sets the image quality to 40.
Piping it through xargs means you avoid the file count limit, and you could run this on your entire file system if you wanted.
This command creates an unmirrored pool using
files. While not recommended, a pool based on files can be
useful for experimental purposes.
Like i said, i havent test it yet, all becouse my internet its soo slow, if you try and works please share, also be nice to do it using the direct url link.
On Windows 2000 or newer, you can use the command line to save the current network interface info.
You can then edit the text file and re-apply it using the netsh -f command (or netsh exec). Keep a bunch of text files around to quickly switch connection info without using extra software.
http://en.wikipedia.org/wiki/Netsh
Mac OSX creates resource forks (http://en.wikipedia.org/wiki/Resource_fork) for every file, which are extremely annoying when transferring projects over to an Ubuntu server for instance
created and tested on:
ProductName: Mac OS X
ProductVersion: 10.6.5
BuildVersion: 10H574
Not always does Xorg run on :0. For times like those, this script allows you to find out which it is.
It is not easy to make perl give a segfault, but this does it. This is a known issue but apparently not easy to fix. This is completely useless except for showing people that perl is not bullet-proof.
From live CD mount(open) the Ubuntu installed drive.
Copy the location (press Ctrl+l, Ctrl+c ) eg: /media/ubuntuuuu
Open terminal (Apllication->accessories->terminal)
Type this:
sudo grub-install --root-directory=/media/ubuntuuuu /dev/sda
(replace /media/ubuntuuuu with what u got (ie paste))
Will show success message. Now reboot
This is a useful command that gives the hostname and the IP Address of your machine, on many OS. Tested on Linux and Solaris.
host command here is followed by `hostname`. Note the ` in the command is a back quote (or grave accent or back tic that usually shares the space with the ~ key). No other options are specified. See sample output.
Uses curl, xmlstarlet and festival to speak your horoscope. Modify the m (month) and d (day) parameters to the astrology web service to hear your personal horoscope.
Read and execute commands from FILENAME in the current shell. The entries in $PATH are used to find the directory containing FILENAME. If any ARGUMENTS are supplied, they become the positional parameters when FILENAME is executed.