Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I work a lot in two folders:

/home/valter/Dropbox/Development/git/valter

/home/valter/Dropbox/Development/git/company

I would like to create command like:

$valter

and enter in /home/valter/Dropbox/Development/git/valter

and

$company

and enter in /home/valter/Dropbox/Development/git/company

/home/valter/Dropbox/Development/git/company

I tried create some alias in ~/.bashrc but nothing works so far.

alias valter="cd /home/valter/Dropbox/Development/git/valter/"

update

@mpy:

meniac chef: valter
No command 'valter' found, did you mean:
 Command 'qalter' from package 'torque-client' (universe)
 Command 'qalter' from package 'gridengine-client' (universe)
 Command 'qalter' from package 'torque-client-x11' (universe)
valter: command not found
share|improve this question
    
The alias should work. Did you source ~/.bashrc? The $ in $company means this is the prompt?! You can also define a variable company=/home/valter/Dropbox/Development/git/company and the use cd $company or (what is a benefit compared to the alias) use cp something $company. –  mpy May 10 '13 at 14:11
    
yes mpy, I did in my /home/valter/.bashrc –  Valter Henrique May 10 '13 at 14:12
    
What is the error when using the alias? –  mpy May 10 '13 at 14:13
1  
@ValterHenrique Please try in a new window/session. –  OmidTahouri May 10 '13 at 14:15
1  
it works Omid, please put this as answer so I can choose it! Thank you! –  Valter Henrique May 10 '13 at 14:17
show 1 more comment

2 Answers 2

up vote 3 down vote accepted

As requested, I'll post an answer, but @mpy's suggestion would've also done the job.

You'll have to re-source your ~/.bashrc using source ~/.bashrc or establish a new session (which would source that for you).

share|improve this answer
    
Not sure how to mention/tag in an answer, so: @mpy –  OmidTahouri May 10 '13 at 14:21
3  
+1: I appreciate. Your merit is, that you formulated it more understandable ;) –  mpy May 10 '13 at 14:24
    
Credit where credit is due :) –  OmidTahouri May 10 '13 at 14:26
    
Thank you mpy and OmidTahouri ;) –  Valter Henrique May 10 '13 at 14:37
add comment

Try replacing "'s (quote) with ''s (single-quote) instead.

Also, make sure you reload your .bashrc either by starting a new terminal emulator window, or by doing . .bashrc in your home folder.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.