The alias's objective is to launch a pdf in my chrome browser. The pdf is entitled "Intro to Java.pdf"; the browser is "Google Chrome"

alias x='open -a "Google Chrome" /Users/ahanagrawal/Documents/"Intro to Java.pdf"'

  • 2
    Works for me, what kind of error etc. are you getting? – nohillside Jul 11 '15 at 17:03
  • In Terminal, spaces have a backslash before the space. Try changing Intro to Java.pdf to Intro\ to\ Java.pdf – TheBro21 Jul 11 '15 at 17:05
  • 3
    @TheBro21 Not if you encase in " as the OP has done - however I would put the 3rd " just before /Users so the whole path is in "" – user151019 Jul 11 '15 at 17:10

Are you sourcing the file in which the alias is defined?

source ~/.bash_profile

If your alias was defined in .bash_profile in your home directory.

To list the defined aliases, simply type 'alias' in the shell. Type 'alias youraliasname' to see whether the alias 'youraliasname' is defined, and if so, its definition.

You must log in to answer this question.

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