From man open
on macos:
The open command opens a file (or a directory or URL), just as if you had
double-clicked the file's icon. If no application name is specified, the
default application as determined via LaunchServices is used to open the
specified files.
So what that commend is doing is just opening the file in whatever the default editor is. Since ~/bash_profile
is a plain text config file, you can open it directly using whatever text editor you prefer (e.g. gedit ~/bash_profile
, nano ~/bash_profile
, etc.).
There are also a few options for opening with an automatic default editor
My personal preference is to be more intentional with what programs I'm using. However you can try out those options and see what works, and what works best for you.
~/.bash_profile
. Only login shells (on either OS) use it. In macOS, Terminal.app runs bash as a login shell; GUI terminals in Ubuntu and other GNU/Linux systems do not. Also, Ubuntu doesn't already have~/.bash_profile
. If you create it, bash uses it instead of~/.profile
, which in Ubuntu has nontrivial contents you probably want run. In Ubuntu, commands you want every interactive bash shell to run should go at the end of~/.bashrc
as vanadium says. – Eliah Kagan Aug 20 '20 at 17:19