Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .