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 eject from sorted by
Terminal - Commands using eject - 9 results
hdiutil eject -force /Volumes/CDNAME
2013-04-23 14:32:38
User: zagdul
Functions: eject
Tags: osx
0

sometimes this helps, when eject button fails

while true; do eject && sleep `expr $RANDOM % 5` && eject -t; done;
2013-01-10 18:40:50
User: joeheyming
Functions: eject sleep
Tags: prank eject
0

Ssh to your co-worker's box and watch them go crazy when the cd player ejects

goburncd() { d=/tmp/goburncd_$RANDOM; mkdir $d && for i in *.[Mm][Pp]3; do lame --decode "$i" "$d/${i%%.*}.wav"; done; sudo cdrecord -pad $d/* && rm -r $d; eject }
2010-07-06 21:58:10
User: meathive
Functions: cdrecord eject mkdir rm sudo
1

My variation on an audio burning command from commandlinefu - this one doesn't crap out if you want to burn a CD in a directory whose permissions don't allow it, and instead rips everything to /tmp. If you mount your music partition like I do using Samba, you probably don't have write permission inside that file system in order to create the temporary directory other audio burning commands here use. Not a bad idea to add cdrom to your groups, and /bin/eject with visudo.

eject -i 1
2010-04-17 02:27:07
User: mdelatorre
Functions: eject
Tags: cdrom
5

This command will lock the hardware eject button of your cdrom drive. Some uses are:

1: If you have a toddler and has discovered the cdrom button

2: If you are carrying a laptop in a bag or case and don't want it to eject if the button is inadvertently pressed.

To unlock the button use:

eject -i 0
eject /dev/sdb; sleep 1; eject -t /dev/sdb
2009-10-11 23:16:49
User: Escher
Functions: eject sleep
7

Remounts a usb disk /dev/sdb, without having to physically remove and reinsert. (Gnome desktop)

eject -x 8 /dev/cdrom
2009-09-25 08:02:30
User: eastwind
Functions: eject
3

this command limit the speed to 8 until next eject of your cdrom disc , can be usefulll when you don't want to listen the sound of your cdrom driver .

eject -x 4
2009-03-18 16:25:11
User: mrttlemonde
Functions: eject
8

Decreasing the cdrom device speed may be more comfortable to watch films (for example)

eject -T [cdrom_device]
2009-02-25 23:53:03
User: raphink
Functions: eject
Tags: device
0

Opens or closes the cdrom device.

while true; do eject /dev/cdrom && eject -t /dev/cdrom; done
2009-02-11 04:41:19
User: fmdlc
Functions: eject
-18

This open the cd rom device and close it in a loop