Commands using sed (1,319)

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

Gets the english pronunciation of a phrase
Sends a string to google tranlator, which converts it to English speech. It's possible to create a nice script to do the job for us, such as #!/bin'bash curl -A "Mozilla" "http://translate.google.com/translate_tts?tl=en&q=$1" > /tmp/speak.mp3 mplayer /tmp/speak.mp3

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

Create a script of the last executed command
Sometimes commands are long, but useful, so it's helpful to be able to make them permanent without having to retype them. An alternative could use the history command, and a cut/sed line that works on your platform. $history -1 | cut -c 7- > foo.sh

Show directories in the PATH, one per line
Shorter version.

Selecting a random file/folder of a folder
Also looks in subfolders

Get a BOFH excuse
Gets a BOFH excuse from the BOFH excuse server (towel.blinkenlights.nl port 666), and passes it through sed and tr to get rid of telnet connection stuff.

Convert entire audio library in parallel
Uses parallel processing Reiteration of my earlier command https://www.commandlinefu.com/commands/view/15246/convert-entire-music-library Usage lc Old_Directory New_DIrectory Old_Format New_Format lc ~/Music ~/Music_ogg mp3 ogg

recurisvely md5 all files in a tree
Found this little gem here: http://info.michael-simons.eu/2008/10/25/recursively-md5sum-all-files-in-a-directory-tree/

Force hard reset on server
Useful when you have some wrong on a server (nfs freeze/ immortal process)

generate random mac address


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: