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.

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.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Commands by bbelt16ag from sorted by
Terminal - Commands by bbelt16ag - 17 results
curl -k https://Username:[email protected]/v1/posts/all?red=api | xml2| \grep '@href' | cut -d\= -f 2- | sort | uniq | linkchecker -r0 --stdin --complete -v -t 50 -F blacklist
2013-05-04 17:43:21
User: bbelt16ag
Functions: cut sort uniq

This commands queries the delicious api then runs the xml through xml2, grabs the urls cuts out the first two columns, passes through uniq to remove duplicates if any, and then goes into linkchecker who checks the links. the links go the blacklist in ~/.linkchecker/blacklist. please see the manual pages for further info peeps. I took me a few days to figure this one out. I how you enjoy it. Also don't run these api more then once a few seconds you can get banned by delicious see their site for info. ~updated for no recursive

lvextend -r -L+100G /dev/VG/LV
2013-04-20 14:29:11
User: bbelt16ag

this command extends your logical volume. then it does a resize2fs on it as well. added the -r switch to make it launch resize.

git branch -d myfeature
git checkout develop; git merge --no-ff myfeature
2012-06-01 08:03:49
User: bbelt16ag
Functions: merge

source::: http://nvie.com/posts/a-successful-git-branching-model/

git checkout develop

Switched to branch 'develop'

git merge --no-ff myfeature
git checkout -b myfeature develop
2012-06-01 08:02:02
User: bbelt16ag

Source ::: http://nvie.com/posts/a-successful-git-branching-model/

Creating a feature branch

When starting work on a new feature, branch off from the develop branch.

git checkout -b myfeature develop
git log --graph --oneline --all
2012-06-01 07:58:15
User: bbelt16ag

this creates a tree of your branch merges. very useful if you want to follow the features you add.

git log --stat
# umount /media/filesystem; e2fsck -f /dev/device ; resize2fs -p /dev/device 200G #actual newsize#;lvreduce --size 200G /dev/device; mount /media/filesystem; df -h /media/filesystem
2011-09-14 08:52:02
User: bbelt16ag

Just the commands for the lvreduce I keep forgetting.

e2fsck -C -v /dev/device
2011-04-08 05:33:39
User: bbelt16ag
Functions: e2fsck

if you happen to start with out the -C switch then you a killall -USR1 e2fsck

blockdev --getsize64 /dev/sd[ab]
2011-01-08 11:25:54
User: bbelt16ag
Tags: blockdev

Compare the disk space for the new and old drive

dd if=/dev/sda of=/home/sam/MBR.image bs=512 count=1
2011-01-08 11:25:02
User: bbelt16ag
Functions: dd
Tags: dd ddrescue

Step#2 Create a copy of the bootload and partition table!

ddrescue -n /dev/old_disk /dev/new_disk rescued.log
ddrescue -r 1 /dev/old_disk /dev/new_disk rescued.log
wget -r --wait=5 --quota=5000m --tries=3 --directory-prefix=/home/erin/Documents/erins_webpages --limit-rate=20k --level=1 -k -p -erobots=off -np -N --exclude-domains=del.icio.us,doubleclick.net -F -i ./delicious-20090629.htm
2009-07-02 01:46:21
User: bbelt16ag
Functions: wget

just a alternative using a saved html file of all of my bookmarks. works well although it takes awhile.

wget -H -r -nv --level=1 -k -p -erobots=off -np -N --exclude-domains=del.icio.us,doubleclick.net --exclude-directories=
cat -n $file | tail -n 100 && head -n number-of-lines-you-want-to-keep > newfile
2009-02-15 01:02:10
User: bbelt16ag
Functions: cat head tail

tells you the number of lines in said file, and then tail the last 100 lines ( or how many are messed up) then u take the total amount of lines and then subract the 100 or so lines u DONT WANT, then do a head -n $new_number and then redirect it to new file.db

watch "df | grep /this/folder/"