
The important part for me is getting the macOS Terminal title to be whatever you want it to be, in an easy manner. Give those commands a try on your system, see if you like them, or change them however you see fit. So, if I want to change the Terminal title to “SERVER”, I type this:īut if I’m currently in a directory named /Applications/MAMP/htdocs/aad828/themes, and I want to set the Terminal title to themes, I use this command instead:
Create a Unix alias (or shell script) to set the Terminal title to the current directory, using settitleĪs a quick example of this, here’s the contents of my settitle script:Īnd here’s an alias I use that sets the Terminal title to the name of the current directory:Īlias settitlePwd='settitle $(basename `pwd`)'. Create a shell script named settitle to do the things I just showed. If you want to set the Terminal title to the name of the current directory, do two things: Exploring Folders & Files pwd to see where you are ls see whats there cd /Downloads to change directory into your Downloads folder cd class-01 pwd to. Bonus: Set the Terminal title to the current directory Note that you can also create a Unix shell script to make this title process easier, i.e., so you can just type something like maketitle "SERVER". I did this by issuing commands like this: what I did was label one of my Terminal windows as "CLIENT", one as "SERVER", and the other as "BUILD". When you issue this command from the command line of a Mac Terminal window, it will change the title in the Terminal's title bar to "YOUR TITLE HERE." The basic escape sequence you need to change the Terminal title from the command line is this: This helped me easily identify what I was doing in each Terminal window. Click the arrow alongside Sharing & Permissions to reveal the ownership and permissions options.
COMMAND LINE FOR MAC CHANGE DIRECTORY MAC OS X
I've been working on a project where I have three Mac Terminal tabs open at one time, and I found it was much easier to work this way when I changed the title on each Terminal window. You can change a files ownership through the same Get Info panel that lets you adjust permissions in the Mac OS X Finder: Select the file in the Finder, then hit Command+i to summon the Get Info window.
Mac Terminal FAQ: How can I change the title on the macOS Terminal app from the Mac/Unix command line?