alias sbrc="source ~/.bashrc" && alias nbrc="nano ~/.bashrc"

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
Sample Output
usage:
$ nbrc
edit .bashrc
press ctrl-x,y,enter
$ sbrc

-19
2009-05-13 02:41:37

These Might Interest You

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"
wonko · 471 weeks and 2 days 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
bwoodacre · 471 weeks and 1 day 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.
xizdaqrian · 471 weeks and 1 day 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
professoralex · 471 weeks and 1 day 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.
bwoodacre · 471 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands



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: