iTerm2 is an awesome utility and makes my interaction w/ the command line much easier. There are a lot of update commands I run on a daily basis, and thought it would be amazing if those could be launched on my user's login. I know that in order to run a script on a user login event a directory has to be created at /System/Library/StartupItems w/ the script that is wished to be run having the same name as the directory (e.g. update_sys/update_sys.sh). The two main issues I have after this is that 1) when the commands are executed there's no terminal window to show any output, and 2) I don't know how to designate iTerm2 (or any other utility) as the primary terminal utility to run scripts. I do have iTerm2 set as the default terminal utility, however some executed scripts will still be launched in Terminal.

Any help is greatly appreciated!

(If my conceptions on how to add commands to a user login event are incorrect or if there is an easier way to do so, please let me know!)


I never used iTerm (or Mac OS); but since iTerm is a terminal emulator, it is probably unsuitable to schedule tasks. On *nixiod systems login scripts are usually executed from files like ~/.profile, /etc/profile, and in shell-specific files like ~/.bashrc and /etc/bash.bashrc. You can read about them in the manual page of you shell (e. g. man 1 bash).


iTerm allows you to run those scripts interactively and as interactive sessions send output to the screen you see the results.

Many programs can also be executed as background processes.

The best way to see output is usually to manually append it to a log. If necessary using echo statements to show where and what command is being run. For the stream of output that comes from builtin command.

I think what you probably want is detailed here: https://unix.stackexchange.com/questions/74520/can-i-redirect-output-to-a-log-file-and-background-a-process-at-the-same-time

i.e. some_cmd > some_file 2>&1 & which will redirect standard output to the log file.

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.