You can use this option to open the root directory, all you have to do this is type the / in path field and click Go. You may not know this but there is a Go to Folder option in Finder that opens up a dialog where you can type the path and it would open up the content of given path in Finder.
Note: Refer this guide to read this in detail along with the screenshots: Show Mac HD in Finder and Desktop. This will make the Macintosh Hd visible in finder sidebar.
To show the Mac HD in Finder sidebar: Open Finder, go to Finder Preferences from the top finder menu and go to Sidebar tab then check the Hard disks sub option listed under Devices. To do this: Open Finder, go to Finder Preferences from the top finder menu and check the Hard disks option in General tab.
However you can change the settings in Finder Preferences to show it in Finder sidebar and as an icon on desktop. By default you won’t find it in Finder and desktop as most of the users do not need to access the system files and folders. In Mac, the root directory can also be referred as Macintosh HD as this will show you the root directory files and folders. Method 1: Show Macintosh HD in Finder and Desktop
#COMMAND LINE FOR MAC DIRECTORY HOW TO#
I will also tell you how to see the hidden directories in root directory. In this guide, I will show you how to access the root directory in Mac, there are several ways to do it. By default Mac doesn’t show you the Root directory in Finder or Desktop. Start up your Terminal again and type in the new alias you just created. If your terminal is open or still running, quit it in order to refresh it. Once you’ve created the alias and set it equal to a command, save the changes you’ve made to the file and close it. This is the primary command in the alias command that makes opening up desired applications via the Terminal super convenient. Open is a great starter for opening up applications and/or documents you use regularly. Important!! Make sure that not only your syntax is correct, but that your directory path is correct! If not, the alias will not be able to successfully jump to your desired location and perform that task. There can’t be any spaces in between the quotation marks and the commands in the string expression, and no spaces in between the equal sign and the alias name. In this instance, the name of the file I want to open is “py-notes.txt” and the absolute file path is /Documents/pythonpractice/py-notes.txt Be Careful Here’s what I type into my ~/.bash_profile:Īlias pynotes="open ~/Documents/pythonpractice/py-notes.txt" You must know the exact filename and file path of the file you want to open! I’ll set this new alias, pynotes, to the command that automatically opens my Python notes. To access my Python notes, I’d like to call it pynotes. Decide on the alias command you want to create.
#COMMAND LINE FOR MAC DIRECTORY CODE#
It’s done all in one!įor example, I’m going to make an alias that will allow me to quickly open a note taking file I use for learning more Python (By the way, they’re just an example of lines of Python code in those notes.). The ~ (tilde, pronounced ‘TIL-dah’) sign is handy because it’ll take you directly to the location of the file without you having to return to the root directory level with separate commands. This command opens the file, regardless of where you may be in any of your directory levels. The alias edit means that when you type the command in that word and press Enter in the Terminal, it will follow the command that it equates to, which would be open ~/.bash_profile. Regardless, let’s get to making our own!Īt the bottom, copy this into the file: # Aliases # Establishing custom commands below alias edit="open ~/.bash_profile"īelow the commenting is where you find the standard syntax for creating an alias (shortcut command) for your machine to recognize. There’s also a possibility that there may not be any. Once you’re in the file, you may find some aliases that have already been established. You could also just open that file with the command open ~/.bash_profile. Type nano ~/.bash_profile if you prefer using the nano GNU in order to make critical changes to the file.
bash_profile, for instance, to open and write into in order to create customized shortcut commands for your daily usage. Once your in the Terminal, type ls -a to be given a list of files and folders that are both hidden and not hidden. You can simply command+ SPACE to bring up the search bar. Make sure you’re going to create these customized commands in the right file. bash_profile might really be where all the magic happens for creating shortcut commands in the Terminal! If you’re sort of familiar with the general Unix command line commands that allow you to navigate through your machine via the Terminal, then creating aliases will help optimize your navigation process! It’s pretty easy, too.