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 tagged youtube-dl from sorted by
Terminal - Commands tagged youtube-dl - 4 results
youtube-dl -c -o "%(title)s" -f 18 https://www.youtube.com/watch?v=5qSCKUCjdKg
2014-06-12 23:31:55
User: tg3793
0

Before you use this command you want to replace everything after the "https:" with the url of the video which you want to download. This string and it's switches will use "youtube-dl" to download the Youtube url into the directory/folder where it is called from. It will output the video using the same name as Youtube uses.

function ytmp3() { while (($#)); do (cd ~/Music; echo "Extracting mp3 from $(youtube-dl -e $1)"; /usr/bin/youtube-dl -q -t --extract-audio --audio-format mp3 $1); shift; done ; }
2013-08-08 06:44:29
User: snipertyler
Functions: cd echo
2

Usage: ytmp3 "YTurl" "YTurl2" "YTurl3" "YTurlN"

Uses the shift command to let you extract the .mp3 from as many youtube urls as you like (or wherever else youtube-dl is supported)

*Requires youtube-dl

Orginal chunk of code:

youtube-dl -q -t --extract-audio --audio-format mp3 URL

taken from here http://www.commandlinefu.com/commands/view/9701/convert-youtube-videos-to-mp3

wget -O "output-filename.mp4" $( youtube-dl -g -f "format-number" "youtube-video-link" )
2013-05-19 16:25:30
Functions: wget
1

in place of "output-filename.mp4" put the name you want the file to be named with.

in place of "youtube-video-link" put the link of the Video page eg: http://www.youtube.com/watch?v=AclA-7YntvE

in place of "format-number" put the number of the file format you would like

How to get the "format-number"

to get format number type in below command before running this command

youtube-dl -F "youtube-video-link"

and it will list all the available formats with the format number, like to download in 360p mp4 use the number "18"

To automatically let it fetch the best quality available just remove the -f "format-number" and you are good to go.

Command in description (Your command is too long - please keep it to less than 255 characters)
2011-02-03 08:25:42
User: __
Functions: command less
0
yt2mp3(){ for j in `seq 1 301`;do i=`curl -s gdata.youtube.com/feeds/api/users/$1/uploads\?start-index=$j\&max-results=1|grep -o "watch[^&]*"`;ffmpeg -i `wget youtube.com/$i -qO-|grep -o 'url_map"[^,]*'|sed -n '1{s_.*|__;s_\\\__g;p}'` -vn -ab 128k "`youtube-dl -e ${i#*=}`.mp3";done;}

squeezed the monster (and nifty ☺) command from 7776 from 531 characters to 284 characters, but I don't see a way to get it down to 255. This is definitely a kludge!