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

alias source .bashrc and nano .bashrc

Terminal - alias source .bashrc and nano .bashrc
alias sbrc="source ~/.bashrc" && alias nbrc="nano ~/.bashrc"
2009-05-13 02:41:37
Functions: alias
-19
alias source .bashrc and nano .bashrc

alias for editing .bashrc and sourcing it with a quick command, very useful for quickly adding and modifying alias' and functions in bashrc, create lots of alias from commandlinefu very quickly, use nano vim or any other edit if you want, very useful if you have a barcode scanner and you want to run commands quickly with barcodes

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

If you want this sort of functionality why would you make two aliases out of it? Why not something like:

alias ebrc="$EDITOR ~/.bashrc && . .bashrc"
Comment by wonko 281 weeks ago

@professoralex I think incremental search could save you from having to define so many aliases. Hitting CTRL-r and then typing a string will incrementally display matching past commands. See here: http://www.network-theory.co.uk/docs/bashref/Searching.html

Comment by bwoodacre 280 weeks and 6 days ago

Why all the negative votes? This was a perfectly good set of commands.I like to tinker with my bashrc and have commands set up like this.

Comment by xizdaqrian 280 weeks and 6 days ago

@bwoodacre, thx I didn't know about ctrl-r, @xizdaqrian thx 4 the support. I also like to mess with my bashrc alot, searching is a great feature, but to be able to alias a command to a shorter name which you can type faster and memorize easier is much better I think, at least for me it is. @wonko, thx your approach is nice

Comment by professoralex 280 weeks and 6 days ago

CTRL-r is really great because it lets you start recalling commands (from the current or past sessions) that you haven't even taken the time to put in .bashrc yet. I can see if you are frequently doing these things then an alias or function makes sense, so then you don't have to depend/bet on it being in your history. However since these are static aliases that take no arguments, the text of the commands can always be recalled with incremental search, and as a bonus, you get to see the actual text of the command when you run it, reminding you of what it actually does rather than hiding it behind some codename that you invented. Just my opinion.

Comment by bwoodacre 280 weeks and 5 days ago

Your point of view

You must be signed in to comment.

Related sites and podcasts