banner



How To Change Directory In Terminal On Mac

The OS X Terminal is a very useful and powerful tool for troubleshooting Mac systems, and in doing so, i of the more mutual steps in getting a task done is to change directories to target files in it. The contemporary method of doing this is to utilize the "cd" (change directory) command and so specify a filesystem path; nevertheless, this can be a scrap frustrating to deal with, specially if you are relatively new to the Last and are not too familiar with text-based filesystem browsing.

Given that Apple tree provides a fairly easy to use filesystem browser in Bone 10 with the Finder, it has implemented options in both the Finder and the Terminal that allow you to utilize the Finder for apace targeting folders in the Terminal without having to blazon total paths.

Open folder in a terminal within Finder
With the service enabled, you lot can open a folder in the Terminal using the contextual menu. Screenshot by Topher Kessler/CNET
  1. Finder services
    Os X services are contextually aware features where i application may provide options for handling data from some other application, such as Apple's summarize service allowing you to select a trunk of text in practically any application and then providing a truncated version of information technology. Services are gear up in the Keyboard Shortcuts section of the Keyboard preferences pane, so are accessed either in the File bill of fare or in the contextual menu by correct-clicking. Ane service that Apple offers for the Finder is to open a new Final window or tab at the selected folder.

    First ensure this service is active by checking it in the "Files and Folders" department of the Services listing, then go to the Finder and locate a binder you lot would like to open in the Terminal. Then right-click it and cull the "New Terminal at Binder" pick that should now be available in the Services submenu. When this is washed, a new Terminal window should open at the selected folder.

  2. Command-dragging folders to the OS X Terminal
    Dragging a folder to the Terminal window with the Command key held down volition issue this command and change directories to the dragged folder (click for larger view). Screenshot by Topher Kessler/CNET
  3. Folder dragging
    Services are peachy for establishing a starting folder in the Terminal, but often yous may wish to specify other binder paths in the electric current Final session. If the target folder is visible in the Finder then you tin can drag it to the Window to input the full file path to information technology at the point of the cursor. This can be exceptionally convenient if you have deeply nested folders you need to access to copy or movement files.
  4. Immediate directory switching
    The folder-dragging feature can be used to switch directories to the target one past typing "cd" (change directory command) followed by a single space and so dragging your target folder to the Terminal before pressing Enter to execute the command; however, if y'all are using Mountain Lion then Apple has implemented a new arroyo to doing this. If yous hold the Command key down when dragging a file or folder to the Terminal, and so the Last will immediately alter to the parent folder of the dragged file (or to the folder itself if a binder is dragged).

These enhancements in OS X should assist Last-savvy users meliorate navigate the filesystem, though for people who are very proficient at the command line, perchance nothing comes shut to an efficient use of the Fustigate shell'southward Tab-completion feature.



Questions? Comments? Have a fix? Post them below or e-mail usa!
Be sure to check us out on Twitter and the CNET Mac forums.

Source: https://www.cnet.com/tech/computing/options-for-changing-folders-in-the-os-x-terminal/

Posted by: huppforgerbours.blogspot.com

0 Response to "How To Change Directory In Terminal On Mac"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel