alias source .bashrc and nano .bashrc

alias sbrc="source ~/.bashrc" && alias nbrc="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
$ nbrc
edit .bashrc
press ctrl-x,y,enter
$ sbrc

2009-05-13 02:41:37

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 · 691 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:
bwoodacre · 691 weeks 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 · 690 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
professoralex · 690 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.
bwoodacre · 690 weeks and 6 days ago ????? ??? ????? ???? SEO ????? ????? ????? ???? ????? ????? ??? ???? ???? ??????? Search Engine Optimization ??? ????? ??????????? ?? ????? ?????????? ????? ????? ?? ????
seofox · 27 weeks and 3 days ago
seofox · 26 weeks and 1 day 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? 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.


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: