0

Say i need to run a couple of commands automatically in a shell everytime i open the shell. how can i automate that?

For Example:

I need to automate the following:

  1. open a shell
  2. cd /specific folder
  3. find . -name 'app_logs'
0

2 Answers 2

1

It depends what OS and Terminal you're using. I imagine most of the popular terminal allows you to customise the startup command. For example, in the Terminal.app that comes with Mac OS X, you can go to Preferences > Settings > Shell > Startup / run command to specify a script to run on startup of each terminal window/tab.

Or you can simply at the commands at $HOME/.profile or $HOME/.bashrc, depending on your OS and shell.

Sign up to request clarification or add additional context in comments.

Comments

1

If it's BASH then you can put these commands into ~/.bashrc

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.