To save some time you can simply make a temporary change to the CDPATH variable. If you’re doing something on a folder that is buried deep in the system, with a long path, you’ll hardly want to be typing that path out each time you reference it. Changing the CDPATH variable (temporarily) All drives, folders, etc., are on levels after the root. That’s the highest (or lowest, depending on your perspective) root or base of the entire system. So typing this command takes up up to the parent directory. Whatever next? If it helps, you can think of the two dots are the mother and father of the pwd. This is starting to sound like a family reunion! Take me home, and go to the parent directory. This command will change the active directory to the Parent Directory, which is the level above whatever directory you are working in. Below is an example of what comes up with the pwd command. To copy your present path just type in pwd, then highlight the path that is displayed (using the mouse pointer), hit Ctrl-C, and then to paste it into a command use Ctrl-V when you have the cursor in the position you wish to paste into. That can save you having to type out long paths. One is that you can actually copy and paste commands and paths (etc.) within Mac OS X Terminal. If you issue the command pwd into Terminal it will display the path of the directory you are presently working in. cd -Ī quick aside: It may help to know that the directory you are currently working in is referred to as the pwd, which stands for Present Working Directory. Go BackĪ bit like the back button in your web browser, this command will take you back to the previous directory you were working in. So it’s a handy little symbol to remember. The ~ symbol can also be utilised in Finder as a reference to the home directory, for instance, when you’re using the “ Go to folder…” command in Finder. If your CDPATH does not point to your home directory (because you temporarily changed it), the failsafe command to go to the home directory is: cd ~ When using cd on its own, the home directory is called from the system variable CDPATH. Without anything after it cd will take you to your home directory. I’ll list the five most useful cd command options here. The cd command has various options that alter what it does. Working in Terminal command line you’ll often need to change directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |