2

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
  • 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 Silva 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 Silva May 10 '13 at 14:17
4

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

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

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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