Retrieves the current WAN ipv4 address via checkip.dyn.com. Show Sample Output
Magic line will extract almost all possible archives from current folder in its own folders. Don't forget to change USER name in sudo command. sed is used to create names for folders from archive names w/o extension. You can test sed expression, used in this command:
arg='war.lan.net' ; x=$(echo $arg|sed 's/\(.*\)\..*/\1/') ; echo $x
If some archives can't be extracted, install packages:
apt-get install p7zip-full p7zip-rar
Hope this will save a lot of your time. Enjoy.
Assuming a convention looking group file, this command will eject oldspiderman from the leagueofsuperfriends group and add newspiderman: oldspiderman:x:551: aquaman:x:552: superman:x:553: newspiderman:x:554: leagueofsuperfriends:x:1000:superman,oldspiderman,superman,aquaman
The original command doesn't work for me - does something weird with sed (-r) and xargs (-i) with underscores all over... This one works in OSX Lion. I haven't tested it anywhere else, but if you have bash, gpg and perl, it should work. Show Sample Output
Updated to the new version of the MW webpage (seems MW does not use cougar anymore, so the other commands do not work nowadays), and using Xidel to parse the page with a html parser instead regex.
Example usage:
pronounce onomatopoetic
I'm not sure how well Xidel works with binary streams (although it seems to work great in tests), so using wget to download the actual wav file might be safer, i.e.:
pronounce(){ wget -qO- $(xidel "http://www.m-w.com/dictionary/$*" -f "replace(css('.au')[1]/@onclick,\".*'([^']+)', *'([^']+)'.*\", '/audio.php?file=\$1&word=\$2')" -e 'css("embed")[1]/@src') | aplay -q;}
Xidel is not a standard cli tool and has to be downloaded from xidel.sourceforge.net
Good because it doesn't use Sed.
Use the command line to log into Dropbox. You have to replace me@yahoo.com with your Dropbox email (note the URL-encoding of "@" as %40). Also replace my_passwd with your Dropbox password. (Note: special characters in your password (such as #) must be url-encoded. You will get a cookie (stored in file "cookie") that you can use for subsequent curl operations to dropbox, for example curl -b cookie https://www.dropbox.com/home. Debug note: If you want to see what data curl posts, use curl's --trace-ascii flag. Show Sample Output
Requires ImageMagick. Extracts date taken from image and renames it properly. Based on StackOverflow answer. Show Sample Output
Take a list of words and let mpv play the pronunciation-file from gstatic. Inspired by http://www.commandlinefu.com/commands/view/12574/download-englishword-pronounciation-as-mp3-file.
note that sed -i is non-standard (although both GNU and current BSD systems support it)
Can also be accomplished with
find . -name "*.txt" | xargs perl -pi -e 's/old/new/g'
as shown here - http://www.commandlinefu.com/commands/view/223/a-find-and-replace-within-text-based-files-to-locate-and-rewrite-text-en-mass.
looks for IPs at the beginning of the line or prefixed by a space
hexdump could be used for conversion too!
Filter out lines of input that contain 72, or fewer, characters. "sed -n" : don't print lines by default "/^.\{73,\}/" : find lines that start with 73 (or more) characters "p" : print them Show Sample Output
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor From this Gist: https://gist.github.com/webstandardcss/3967760857d6be470dda
Just pulls a quote for each day and displays it in a notification bubble...
or you can change it a bit and just have it run in the terminal
wget -q -O "quote" https://www.goodreads.com/quotes_of_the_day;echo "Quote of the Day";cat quote | grep '“\|/author/show' | sed -e 's/<[a-zA-Z\/][^>]*>//g' | sed 's/“//g' | sed 's/”//g'; rm -f quote
Show Sample Output
Not better, but more lightweight (sed instead of perl).
Above command is reduced due to length restriction of less than 256 characters and entity encoding of "Save" command on this page. This is complete command (best without entity encoding):
echo -e '\x2Helo folks\t!\r' | sed "y/\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xA\xB\xC\xD\xE\xF\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20/␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟␠/"
␂Helo␠folks␉!␍
Show Sample Output
Calculate the date of Sysadmin day (last Friday of July) of any given year Show Sample Output
Thx Mass1 for the sharing
When booting a VM through OpenStack and managed through cloudinit, the hosts file gets to write a line simiar to 127.0.1.1 ns0.novalocal ns0 This command proven useful while installing a configuration manager such as Salt Stack (or Puppet, or Ansible) and getting node name
This sed command will search for 4.2.2.2 in all lines of test.txt and replace comment symbol ";" . You can use it for other purpose also.
Google Cloud SDK comes with a package manager `gcloud components` but it needs a bit of `sed` to work. Modify the "^| Not" bit to change the package selection. (The gcloud --format option is currently broken) Show Sample Output
Use sed to search and replace pipes for tabs in file stream with backup
Get you IPV 6 address with curl and sed. Show Sample Output
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.
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: