Commands tagged sed (376)

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

List files
Shortcut to list files in the current path.

Create a random file of a specific size
This will create a 10 MB file named testfile.txt. Change the count parameter to change the size of the file. As one commenter pointed out, yes /dev/random can be used, but the content doesn't matter if you just need a file of a specific size for testing purposes, which is why I used /dev/zero. The file size is what matters, not the content. It's 10 MB either way. "Random" just referred to "any file - content not specific"

Alias to securely run X from tty and close that tty afterwards.
There are different ways to run X, I prefer to run it without xdm/gdm. The problem is you can't lock X because one can press Ctrl+Alt+F1, press Ctrl+Z and kill you X locking process. Of course you can disable Ctrl+Alt* or Ctrl+Alt+Backspace keys, but it's inconvinient if you really need to switch into console.

Rename files in batch

Mysql uptime
show Mysql uptime

Remove all subversion files from a project recursively
This command will remove all .svn folder from your project if you need to manual remove the subversion files.

grep certain file types recursively
-exec works better and faster then using a pipe

SoX recording audio and trimming silence
Records audio from your mic in FLAC (Free Lossless Audio Codec) format, starts only after it detects at least 0.1 seconds of noise and stops after 1 second of silence. You can adjust the percent values (sensitivity) to best fit your microphone and voice (0.1% if you have a great quality mic, higher if you don't, 0% does not trim anything). Useful for speech recognition in conjunction with my previous command titled 'Google voice recognition "API"' (http://www.commandlinefu.com/commands/view/8043/google-voice-recognition-api).

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Find usb device in realtime
Using this command you can track a moment when usb device was attached.


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: