Shortcut MAC/Linux terminal

Asked

Viewed 454 times

1

People how can I create a shortcut in the terminal ? type instead of typing cd xxxx/xxxx/xxxx i just type goDevWeb ? Thank you

  • Your question does not enter the scope of the SOPT, so it will be closed as discounted, try to be more specific in what question. See in Help Center How To Ask.

1 answer

2


Opa!

That’s the way it is:

On your Mac in the user folder open the file .bash_profile. It can be in the program in which you program.

It is hidden. In case your Finder does not show the hidden files type the following command in the terminal:

defaults write com.apple.finder AppleShowAllFiles -bool true

After that open the file .bash_profile.

Now you create a function in the file:

goDevWeb(){
    cd xxx/yyyy/wwwww;
}

Then in the terminal in the folder usuario type so to compile the file:

source ~/.bash_profile.

Then take the test.

  • friend within the user himself does not have the file, even using the command does not appear....

  • Restarts Finder. With the mouse over the Finder icon in the Dock, hold Option and right click, click Restart.

  • not so... not exist a command in the terminal that fits directly by the came ?

  • What hidden files you have in the folder usuario ?

  • Applications Movies Composer.phar Creative Cloud Files Music https: Desktop Netbeansprojects Laravel Documents Pictures mcrypt Downloads Public readme.Textile Google Drive branches tags Library Composer.json trunk

  • friend after restarting Finder again appeared several files, but none with the bash_profile name only bash_history bash_session

  • There’s one that calls .profile or .bashrc ?

  • no. I’m using the new version of mac that came out last ....

  • Updated list of files when using ls -a : . . netbeans-derby Movies .. . oracle_jre_usage Music . Cfusertextencoding . P2 Netbeansprojects . Ds_store . Putty Pictures . Trash . ssh Public . Webide100 . Subversion branches . Webstorm10 . svn Composer.json . Webstorm11 . viminfo Composer.phar . android Applications https: . bash_history Creative Cloud Files Laravel . bash_sessions Desktop mcrypt . Composer Documents readme.Textile . config Downloads tags . eclipse Google Drive trunk . Gradle Library

  • Then create a file .bash_profile and do what I told you.

  • 1

    gave cert... obliged to

Show 6 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.