Hide

What's this?

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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

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.

Hide

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

Commands by nickleus from sorted by
Terminal - Commands by nickleus - 9 results
for f in *;do flac -cd $f |lame -b 192 - $f.mp3;done
ffmpeg -i 100_0029.MOV -ss 00:00:00 -t 00:04:00 100_0029_1.MOV
2010-08-08 23:43:28
User: nickleus
2

i have a large video file, 500+ MB, so i cant upload it to flickr, so to reduce the size i split it into 2 files. the command shows the splitting for the first file, from 0-4 minutes. ss is start time and t is duration (how long you want the output file to be).

credit goes to philc: http://ubuntuforums.org/showthread.php?t=480343

NOTE: when i made the second half of the video, i got a *lot* of lines like this:

frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbit

just be patient, it is working =)

flac -cd input.flac |lame -h - output.mp3
2010-03-05 23:54:21
User: nickleus
2

if you haven't already done so, install lame and flac:

sudo apt-get install lame flac

sudo echo 0 > /sys/block/sdb/queue/rotational
2009-11-27 12:16:17
User: nickleus
Functions: echo sudo
5

if you still get a permissions error using sudo, then nano the file:

sudo nano -w /sys/block/sdb/queue/rotational

and change 1 to 0

this thread:

http://www.ocztechnologyforum.com/forum/showpost.php?p=369836&postcount=15

says that this will "help the block layer to optimize a few decisions"

iostat -m -d /dev/sda1
2009-11-27 12:00:48
User: nickleus
3

The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates.

in ubuntu to get the iostat program do this:

sudo apt-get install sysstat

i found this command here:

http://www.ocztechnologyforum.com/forum/showthread.php?t=54379

mp32ogg file.mp3
2009-11-16 20:22:48
User: nickleus
-1

why would you want to convert mp3's to ogg? 1 reason is because ardour doesn't support mp3 files because of legal issues. this is really the only reason you would do this, unless you have really bad hearing and also want smaller file sizes, because converting from one lossy format to another isn't a good idea.

oggenc *.wav
2009-11-11 14:26:01
User: nickleus
Tags: ogg
2

cd to the folder containing the wav files and convert them all to ogg format.

in my sample output i use the -a and -l flags to set the author and album title.

to get the oggenc program in ubuntu linux run:

sudo apt-get install oggenc

flac --best *.wav
2009-11-11 14:17:24
User: nickleus
Tags: bash Ubuntu
2

cd to the folder containing the wav files, then convert them all to flac. yeah baby!

in ubuntu, to get the flac program just:

sudo apt-get install flac

flac file input formats are wav, aiff, raw, flac, oga and ogg

apt-file find bin/programname
2009-11-10 10:21:45
User: nickleus
Functions: apt find
7

search ubuntu's remote package source repositories for a specific program to see which package contains it