Mac os x shell alias

Make your .bash_profile file if you don’t yet have one
Contents:
  1. About bash_profile and bashrc on macOS – Scripting OS X
  2. Your Answer
  3. Setting environment variables on Mac OS X

I've got some alias' set up for opening a new tab within terminal, and doing other stuff, even an alias for running the debug shell script, but the debug. Alias expansion is done only from the interactive shell, but not within scripts so debug is expanded to newtab , but newtab is not itself expanded, since it is called from a script.

About bash_profile and bashrc on macOS – Scripting OS X

Exporting is necessary, because scripts run in sub-shells, although for the particular instance you cite it is only newtab that needs to be a function. Functions can be used instead of aliases everywhere, but can do a lot more, such as adding an extra parameter to the end of the run string, a very simple requirement that aliases cannot do.

When might you use aliases?

In fact, they can do anything scripts can, but unlike scripts they run in the current shell, so they can change the environment and the current directory, for which a script needs. Home Questions Tags Users Unanswered.

Mac OS X Sierra Asked 1 year, 7 months ago. Active 1 year, 7 months ago.

Your Answer

Viewed times. This allows us to copy from your question into an answer. As well as reducing typing, it also prevents typing errors in the answer. AFH for text inclusions it is preferable to copy and paste into your answer?? Your answer?? As the world's worst typist, I would have preferred to copy and paste these from your question, to prevent errors, and I can't do this from an image. If you're using the system default shell on Home Questions Tags Users Unanswered. Ask Question.

Setting environment variables on Mac OS X

Asked 7 years, 10 months ago. Active 1 month ago. Viewed k times. Eonil Eonil 1, 8 8 gold badges 23 23 silver badges 29 29 bronze badges. Hauke Laging Ah right, BSD ls doesn't support --color. Maybe this is Mac OS X specific.


  1. cd drive not working on mac.
  2. Nate Landau's home on the web.
  3. Why use aliases??
  4. how to get photoshop for free 2015 mac;

Don't forget to restart your terminal app after the changes. Jpsy Jpsy 4 4 silver badges 6 6 bronze badges. Also, remember to logout from the terminal or close the app and restart.

Linux/Mac Terminal Tutorial: Creating Aliases for Commands

Thanks crmpicco, I have updated the answer accordingly. Gilles 'SO- stop being evil' Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. HalosGhost 3, 9 9 gold badges 22 22 silver badges 36 36 bronze badges. Sixhammers Sixhammers 41 2 2 bronze badges.


  1. Moving to zsh, part 4: Aliases and Functions;
  2. More about bash shell aliases.
  3. MacOS Catalina and Above.
  4. Subscribe to RSS.
  5. download iphone photos to mac computer.
  6. Subscribe to RSS.

Giving users steps to reproduce your solution is great, but being specific and concise is too. Asped Asped 3 3 bronze badges.


  1. svn for mac os x lion;
  2. games to play on the mac free.
  3. MySQL :: MySQL Reference Manual :: General Notes on Installing MySQL on OS X.
  4. Alias substitution.
  5. fleetwood mac sentimental lady video.

Jesse P. Press o to add a new line to the file. Type following to write your new changes and exit the editor: :wq Reopen terminal and you should be able to use the alias ll. Flavio Caduff Flavio Caduff 11 2 2 bronze badges.