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 using lftp from sorted by
Terminal - Commands using lftp - 8 results
lftp -u<<credentials>> <<server>> -e "du -a;exit" > server-listing.txt
2013-09-24 08:23:44
User: danbst
Functions: lftp
Tags: ftp lftp
0

Creates a file with contents like `du -a`, only it is remote server filesystem hierarchy. Very usefull then for grep-ing without remote connection.

lftp -c "pget -n 10 http://example.com/foo.bar"
lftp -e 'pget http://address_to_file; exit; '
2013-04-07 03:29:07
User: o0110o
Functions: lftp
1

Make sure the file you use in your test is > 50mb to get good results.

Dependancies:

sudo apt-get install lftp iperf

lftp -u user,pass ftp://site.com -e 'pget -c -n 6 file'
2012-12-11 16:18:52
User: bugmenot
Functions: lftp
1

This is for files only, for directories 'mirror' has to be used.

lftp -u user,pass ftp://site.com/ -e 'mirror -c --parallel=3 --use-pget-n=5 "Some folder"'
2012-11-24 11:29:48
User: bugmenot
Functions: lftp
0

It works best if you first login and then do the fetch:

lftp -u user,pass ftp://site.com/

mirror -c --parallel=3 --use-pget-n=5 "Some folder"

lftp -ulogin,passwd -e "mirror --reverse /my/from/dir/ /ftp/target/dir/" ftp.server.xx
lftp -e "mirror -c" http://example.com/foobar/
2010-05-16 03:49:30
User: tamasrepus
Functions: lftp
15

wget/curl/friends are not good with mirroring files off websites, especially those with Apache-generated directory listings. These tools endlessly waste time downloading useless index HTML pages. lftp's mirror command does a better job without the mess.

dd if=/dev/sda5 bs=2048 conv=noerror,sync | gzip -fc | lftp -u user,passwd domain.tld -e "put /dev/stdin -o backup-$(date +%Y%m%d%H%M).gz; quit"