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.


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.
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

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!
Hide

Top Tags

Hide

Functions

Print all the lines between 10 and 20 of a file

Terminal - Print all the lines between 10 and 20 of a file
sed '10,20!d'
2011-03-31 15:30:24
User: tr00st
Functions: sed
3
Print all the lines between 10 and 20 of a file

Subtly different to the -n+p method... and probably wrong in so many ways....... But it's shorter. Just.

Alternatives

There is 1 alternative - vote for the best!

Terminal - Alternatives
sed -n 5p <file>
2009-10-15 11:00:48
User: Waldirio
Functions: sed
39

You can get one specific line during any procedure. Very interesting to be used when you know what line you want.

awk 'NR >= 3 && NR <= 6' /path/to/file
2011-12-14 14:28:56
User: atoponce
Functions: awk
Tags: awk
7

This command uses awk(1) to print all lines between two known line numbers in a file. Useful for seeing output in a log file, where the line numbers are known. The above command will print all lines between, and including, lines 3 and 6.

sed -n '3,6p' /path/to/file
2011-12-14 15:09:38
User: flatcap
Functions: sed
Tags: sed
6

Print all lines between two line numbers

This command uses sed(1) to print all lines between two known line numbers in a file. Useful for seeing output in a log file, where the line numbers are known. The above command will print all lines between, and including, lines 3 and 6.

head -n 20 <filename> | tail

Know a better way?

If you can do better, submit your command here.

What others think

http://www.yeezy-outlet.us/ Yeezy outlet

http://www.yeezy-outlet.us/ Cheap Yeezy boost 350

http://www.yeezy-outlet.us/ Adidas Yeezy outlet

http://www.yeezy-outlet.us/ Yeezy boost 350 v2

http://www.yeezy-outlet.us/ Yeezy outlet online

http://www.yeezy-outlet.us/ Yeezy shoes outlet

http://www.yeezy-outlet.us/ Adidas Yeezy

http://www.yeezy-outlet.us/ Yeezy Shoes

http://www.yeezy-outlet.us/ Yeezy Boost 350

http://www.yeezy-outlet.us/ Yeezy Adidas

http://www.yeezy-outlet.us/ Adidas Yeezy Boost 350

http://www.yeezy-outlet.us/ Yeezys

http://www.yeezy-outlet.us/ kanye west

http://www.adidasnmdsales.us/ Adidas NMD

http://www.adidasnmdsales.us/ Adidas NMD R1

http://www.adidasnmdsales.us/ Adidas NMD sale

http://www.adidasnmdsales.us/ NMD

http://www.adidasnmdsales.us/ NMD Adidas

http://www.adidasnmdsales.us/ NMD XR1

http://www.nike-airmax90.com/ Nike Air Max

http://www.nike-airmax90.com/ Buy Nike Air Max Shoes Shopping

http://www.nike-airmax90.com/ Air Max 90

http://www.nike-airmax90.com/ Shoes Air Max

http://www.nike-airmax90.com/ Nike Air max 2017

http://www.nike-airmax90.com/ nike shoes 70% off

http://www.nike-airmax90.com/ air max

http://www.nike-airmax90.com/ buy cheap air max shoes

http://www.nike-airmax90.com/ cheap nike shoes

http://www.nike-airmax90.com/ nike air max 90

http://www.running-shoes.top/ Running shoes

http://www.running-shoes.top/ New Balance Original

http://www.running-shoes.top/ Puma Walking Shoes Outlet

http://www.running-shoes.top/ Cheap Reebok Shoes

http://www.running-shoes.top/ Skechers Women's

http://www.running-shoes.top/ New Balance Running Shoes

http://www.starboots.us/ Basketball Shoes

http://www.starboots.us/ KOBE12 Shoes Outlet

http://www.starboots.us/ Nike Air Zoom KD9 Shoes Sale

http://www.starboots.us/ Nike LeBron14 Shoes

http://www.starboots.us/ kyrie3 Shoes Sale

http://www.starboots.us/ Curry3 Shoes Sale

http://www.michael-kors-bags.us/ Michael Kors bags

http://www.michael-kors-bags.us/ Michael Kors

http://www.michael-kors-bags.us/ Cheap Michael Kors bags

http://www.michael-kors-bags.us/ Michael Kors outlet

http://www.michael-kors-bags.us/ Michael Kors online

http://www.michael-kors-bags.us/ Michael Kors factory sale

http://www.michael-kors-bags.us/ Michael Kors shopping

http://www.michael-kors-bags.us/ discontinued michael kors ha

http://www.asics.us.com/ Asics shoes outlet

http://www.asics.us.com/ Asics Running shoes

http://www.asics.us.com/ Asics Gel Kayano

http://www.asics.us.com/ Asics outlet

http://www.asics.us.com/ Asics shoes

http://www.asics.us.com/ Asics outlet store online

http://www.asics.us.com/ Asics

http://www.asics.us.com/ Asics Running

http://www.asics.us.com/ Discount Asics Running Shoes

http://www.coach-online.us/ Coach online

http://www.coach-online.us/ Coach outlet

http://www.coach-online.us/ Coach online handbags

http://www.coach-online.us/ Coach factory online

http://www.coach-online.us/ Coach handbangg online

http://www.coach-online.us/ cheap Coach online

http://www.timberland-outlets.org/ Timberland outlet

http://www.timberland-outlets.org/ Timberland Shoes

http://www.timberland-outlets.org/ Timberland boots

http://www.timberland-outlets.org/ Timberland boots sale

http://www.timberland-outlets.org/ Timberland factory outlet

http://www.timberland-outlets.org/ Timberland boots outlet

http://www.timberland-outlets.org/ Timberland shoes outlet

http://www.timberland-outlets.org/ timberland outlet work boots

http://www.jordan-air.us/ Air Jordan

http://www.jordan-air.us/ Discounted-Nike Discounted Air Jordan

http://www.jordan-air.us/ Air Jordan Shoes On Sale

http://www.jordan-air.us/ Air Jordan Shoes

http://www.jordan-air.us/ Cheap Jordan Shoes

http://www.vapor-max.com/ VaporMax

http://www.vapor-max.com/ Nike VaporMax

http://www.vapor-max.com/ Nike Air Vapor Max

http://www.vapor-max.com/ Air VaporMax

http://www.vapor-max.com/ Nike Vapor Max Shoes

http://www.vapor-max.com/ Air Max Vapor Max

http://www.vapor-max.com/ Nike Vapor Max

http://www.vapor-max.com/ Air Max Shoes

http://www.vapor-max.com/ Cheap Nike Shoes2017

http://www.vapor-max.com/ Nike Vapor Max

http://www.vapor-max.com/ Vapor Max

http://www.vapor-max.com/ Nike Air MAX

http://www.vapor-max.com/ Nike VaporMax Price

http://www.vapor-max.com/ Max Air

http://www.vapor-max.com/ Womens 2017 Nike Shoes

http://www.nfljerseys.us/ Cheap NFL Jerseys

http://www.longchampbags.us.com/ Longchamp Outlet

http://www.adidas-uk.org.uk/ Adidas

http://www.raybansunglasses.ca/ Ray Ban Sunglasses

http://www.yeezys.org/ Yeezys

http://www.kade-sapde.us.com/ Kade Sapde

http://www.adidasoutlets.us.com/ Adidas Outlet

http://www.nike-stores.fr/ Nike Store

http://www.underarmouroutlet.us.com/ Under Armour

http://www.timberlanduk.org.uk/ Timberland

http://www.jordan12.us/ Jordan 12

http://www.kedsshoesforwomen.com/ Keds Shoes

http://www.nikeairmax.us/ Nike Air Max

http://www.outlettoms.us/toms-women-c-1/ Toms Outlet

http://www.ultraboostuncaged.us/ Ultra Boost

http://www.mlb-jerseys.us/ Cheap MLB Jerseys

http://www.adidas-nmds.com/ Adidas NMD

http://www.oakleyoutlet.net.co/ Oakley Outlet

http://www.katespadeoutlets.us/ Kate Spade Outlet

http://www.adidas-outlet.org/ Adidas Outlet

http://www.nikeairmax-90.com/ Nike Air Max 90

http://www.timberland-outlet.us/ Timberland Outlet

http://www.adidas-nmd.org.uk/ Adidas NMD

http://www.adidaseqt.com/ Adidas EQT

http://www.ralphlaurens.org.uk/ Ralph Lauren UK

http://www.jordan4.us/ Jordan 4

http://www.cheapjordan-shoes.com/ Cheap Jordan

http://www.adidasnmdoutlet.com/ Adidas NMD

http://www.katespadeoutlet.us.org/ Kate Spade Outlet

http://www.longchamp-outlet.ca/ Longchamp Outlet

http://www.vapor-max.org/ VaporMax

http://www.spinnerfidgettoy.us/ Spinner Fidget Toy

http://www.raybanoutletclearance.com/ Ray Ban Outlet

http://www.yeezy-boost350v2.com/ Yeezy Boost 350 V2

http://www.nfljerseys.us/ Cheap NFL Jerseys

http://www.longchampbags.us.com/ Longchamp Handbags

http://www.adidas-uk.org.uk/ Adidas

http://www.vapor-max.com/ Air Max Shoes

http://www.raybansunglasses.ca/ Ray Ban Sunglasses

http://www.yeezys.org/ Yeezys

http://www.yeezyboost-350.org.uk/ Yeezy

http://www.kade-sapde.us.com/ Kade Sapde

http://www.adidasoutlets.us.com/ Adidas Outlet

http://www.nike-stores.fr/ Nike Store

http://www.yeezyboost350v2.com/ Yeezy Boost 350 V2

http://www.adidas-outlet.in.net/ Adidas Outlet

http://www.underarmouroutlet.us.com/ Under Armour

http://www.timberlanduk.org.uk/ Timberland

http://www.jordan12.us/ Jordan 12

http://www.nikeairmax.us/ Air Max

http://www.outlettoms.us/ Toms Outlet

http://www.ultraboostuncaged.us/ Ultra Boost

http://www.mlb-jerseys.us/ MLB Jerseys

http://www.adidas-nmds.com/ Adidas NMD

http://www.oakleyoutlet.net.co/ Oakley Outlet

http://www.katespadeoutlets.us/ Kate Spade Outlet

http://www.adidas-outlet.org/ Adidas Outlet

http://www.nikeairmax-90.com/ Nike Air Max 90

http://www.vapor-max.com/ Vapor Max

http://www.timberland-outlet.us/ Timberland Outlet

http://www.adidas-nmd.org.uk/ Adidas NMD

http://www.adidaseqt.com/ Adidas EQT

http://www.ralphlaurens.org.uk/ Ralph Lauren

http://www.tomsoutlet-online.us.com/ Toms Outlet

http://www.jordan4.us/ Jordan 4

http://www.cheapjordan-shoes.com/ Cheap Jordan

http://www.adidasnmdoutlet.com/ Adidas NMD

http://www.jordan-shoes.in.net/ Jordan Shoes

http://www.katespadeoutlet.us.org/ Kate Spade Outlet

http://www.longchamp-outlet.ca/ Longchamp Outlet

http://www.adidasyeezy.org/ Adidas Yeezy

http://www.adidasnmdsales.us/ Adidas NMD R1

http://www.nike-airmax90.com/ Nike Air Max 90

http://www.running-shoes.top/ Running shoes

http://www.starboots.us/ Basketball Shoes

http://www.michael-kors-bags.us/ Michael Kors bags

http://www.yeezy-outlet.us/ Adidas Yeezy outlet

http://www.asics.us.com/ Asics

http://www.coach-online.us/ Coach Factory Outlet

http://www.vapor-max.com/ Cheap Nike Shoes 2017

http://www.timberland-outlets.org/ Timberland outlet

http://www.jordan-air.us/ Air Jordan

http://www.adidasyeezy.org/ Adidas Yeezy

http://www.nikeairvapormax.top/ Nike VaporMax

http://www.airmaxvapor.com/ Air Maxvapor

http://www.airmaxvapor.com/ Vapor

http://www.airmaxvapor.com/ Nike Vapor

http://www.airmaxvapor.com/ VaporMax

http://www.airmaxvapor.com/ Vapor Max

http://www.airmaxvapor.com/ Nike VaporMax

http://www.airmaxvapor.com/ Nike Vapor Max

http://www.airmaxvapor.com/ Nike Air Vapor Max

http://www.airmaxvapor.com/ Air Max Vapor

http://www.airmaxvapor.com/ Air Vapor Max

http://www.airmaxvapor.com/ Nike Vapor Max Shoes

http://www.airmaxvapor.com/ Air Max Vapor Max

http://www.airmaxvapor.com/ Nike Vapor Max

http://www.airmaxvapor.com/ Vapor Max Nike

http://www.nikeairvapormax.top/ Vapor

http://www.nikeairvapormax.top/ Nike Vapor

http://www.nikeairvapormax.top/ VaporMax

http://www.nikeairvapormax.top/ Vapor Max

http://www.nikeairvapormax.top/ Nike VaporMax

http://www.nikeairvapormax.top/ Nike Vapor Max

http://www.nikeairvapormax.top/ Nike Air Vapor Max

http://www.nikeairvapormax.top/ Nike Air Vapor Max

http://www.nikeairvapormax.top/ Air Vapor Max

http://www.nikeairvapormax.top/ Nike Vapor Max Shoes

http://www.nikeairvapormax.top/ Air Max Vapor Max

http://www.nikeairvapormax.top/ Nike Vapor Max

http://www.nikeairvapormax.top/ Vapor Max Nike

http://www.adidasyeezy.org/ Yeezy outlet

http://www.adidasyeezy.org/ Cheap Yeezy boost 350

http://www.adidasyeezy.org/ Adidas Yeezy outlet

http://www.adidasyeezy.org/ Yeezy boost350v2

http://www.adidasyeezy.org/ Yeezy outlet online

http://www.adidasyeezy.org/ Yeezy shoes outlet

http://www.adidasyeezy.org/ Yeezy

http://www.adidasyeezy.org/ Yeezy Shoes

http://www.adidasyeezy.org/ Adidas Yeezy Boost

http://www.adidasyeezy.org/ Yeezy Adidas

http://www.adidasyeezy.org/ Adidas Yeezy outlet online

http://www.adidasyeezy.org/ Yeezy Boost 350

http://www.adidasyeezy.org/ Adidas Yeezy Outlet

http://www.adidasyeezy.org/ Yeezy Outlet

http://www.adidasyeezy.org/ Yeezy Boost 350 V2 Outlet

http://www.adidasyeezy.org/ Yeezy Boost 350 Cheap

http://www.adidasyeezy.org/ Adidas Yeezy

http://www.adidasyeezy.org/ Adidas Yeezy Shoes Outlet

http://www.air-max2018.com/ Air Max 2018

Comment by sevenclock 5 weeks and 3 days ago

Your point of view

You must be signed in to comment.