Mac os run terminal in folder

Открыть терминал по адресу папки в macOS

Некоторые пользователи macOS даже не знают, что такое терминал, а некоторые пользуются им постоянно. В macOS есть простая, но полезная функция — открыть терминал из файлового менеджера Finder по адресу текущей папки.

Чтобы включить данную функциональность откройте Системные настройки. Для этого щелкните в главном меню значок яблока и выберите пункт Системные настройки .

В Системных настройках выберите Клавиатура . Мы выбрали Клавиатура , так как необходимые нам опции находятся в настройках горячих клавиш клавиатуры.

Откроются настройки Клавиатуры. Выберите вкладку Сочетания клавиш . В левом списке выберите пункт Службы . В правом списке установите галочку у пункта Новый терминал по адресу папки . Также можно нажать справа кнопку добавить и установить сочетание клавиш для данной функции. Обратите внимание, там же в списке можно включить пункт Новая вкладка терминала по адресу папки .

Когда настройки выполнены, откройте файловый менеджер Finder и щелкните правой кнопкой по папке или по папке из пути в статусной строке. В открывшемся меню выберите пункт Службы->Новый терминал по адресу папки .

Источник

Open or quit Terminal on Mac

Each window in Terminal represents an instance of a shell process. The window contains a prompt that indicates you can enter a command. The prompt you see depends on your Terminal and shell preferences, but it often includes the name of the host you’re logged in to, your current working folder, your username and a prompt symbol. For example, if a user named michael is using the default zsh shell, the prompt appears as:

This indicates that the user named michael is logged in to a computer named MacBook-Pro, and the current folder is his home folder, indicated by the tilde (

Open Terminal

On your Mac, do one of the following:

Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.

In the Finder , open the /Applications/Utilities folder, then double-click Terminal.

Quit Terminal

In the Terminal app on your Mac, choose Terminal > Quit Terminal.

Quit a shell session

In the Terminal app on your Mac, in the window running the shell process you want to quit, type exit , then press Return.

This ensures that commands actively running in the shell are closed. If anything’s still in progress, a dialogue appears.

If you want to change the shell exit behaviour, see Change Profiles Shell preferences.

Источник

How to Open Any Folder from the Mac Terminal

The standard way to open any directory within macOS is to open a Finder window and use it to navigate to a specific location on your hard drive. There’s also another way to open folders: use the Terminal. It may not be something you use every day unless you’re a developer, but the power is there if you need to call on it.

As such, this post will show you how to open any folder from the macOS Terminal. We also show you how to create a custom shortcut to carry out this command.

Also read: How to Customize Your Mac’s Terminal for Better Productivity

Читайте также:  Что нужно знать при установке windows

Why You’d Want to Open a Folder From the Mac Terminal

As we noted, the preferred way of opening a folder is by using Finder. This is a Graphical User Interface (GUI), and it’s macOS’s directory navigation de jure. But it’s not the only way to access files or folders within macOS.

We admit, using the Terminal to open folders isn’t a natural way to get around macOS. Though, you’ll find it will come in handy in the following situations:

  • If you’re a command line user, it may be something you have in your toolbox.
  • Developing for Mac often means working within the Terminal. If this is the case, it may be the path of least resistance to stay inside the Terminal as much as possible.
  • If you’re in a rare situation where macOS is acting as server software, you may only be able to use the Terminal to navigate the Operating System (OS).

Given the above, it’s easy to see why you may want to have the knowledge. Next, we show you how to get the job done.

How to Open Any Folder from the Mac Terminal

To begin, you’ll need to open the Terminal. This can be found either through the “Application -> Utilities” folder

or by typing “Terminal” in Spotlight. Once it’s open, you won’t need any dependencies to open any folder from the Mac Terminal. You’ll only need the open command. The general syntax is as follows:

For example, to open the Pictures folder, you’d use the following:

This will open the Pictures folder in a Finder window, which you can then use to access its files.

There are a bunch of other short commands you can use to access specific folders. For example:

  • To open the Root directory, use open / .
  • For your Home folder (i.e. the folder containing Desktop, Documents, and other folders specific to the user), type open

.

  • To open the current working folder within Finder, use open . .
  • To touch on this last point further, you may be navigating your files using the Terminal and have a need to open the folder you’re in.

    While the commands so far open specific folders, you can also launch (and update) applications from the Terminal without using Finder. For example, to open Safari, type open /Applications/Safari.app .

    Of course, you’re able to replace Safari with any app on your system as long as you know its file name.

    Open a Folder in Terminal from a Shortcut Menu

    It may be that you want to reverse the situation and open a Finder directory in the Terminal. In other words, make it the current working directory. You can do this by adding a right-click shortcut.

    To do this, head to System “Preferences -> Keyboard.”

    Next, navigate to the Shortcuts tab. Here, select the Services menu and scroll down to find “New Terminal at Folder.”

    If you select any folder within Finder, open the Services menu from the Toolbar and choose “New Terminal at Folder.”

    This is going to be ideal if you often switch between a GUI and the Terminal.

    In Summary

    The Mac Terminal isn’t something you’ll encounter often. In contrast, a developer or sysadmin might spend most of their time using a Terminal app. Given this, opening a folder is a basic task that can keep you on the command line as long as possible. All you need is the open command and the path to your folder.

    If you’re looking for more to do with the Terminal, we’ve looked at searching the Web without a browser, direct from the command line. Will this inspire you to use the Mac Terminal more? Share your thoughts in the comments section below!

    Tom Rankin is a quality content writer for WordPress, tech, and small businesses. When he’s not putting fingers to keyboard, he can be found taking photographs, writing music, playing computer games, and talking in the third-person.

    Источник

    How to Launch Terminal in the Current Folder Location on Mac

    Often while working with local files you may need to open a Terminal window in your current folder location. While doing that is as easy as pressing a button and clicking an option in Windows, things are different on a Mac. You are required to first enable an option in your Preferences panel, and then you will have the option to launch an instance of Terminal in any folder of your choice on your Mac.

    A local instance of Terminal lets you execute commands while keeping the files in that folder in mind. It lets you work with the files right there in that folder.

    Here’s how you can launch Terminal in the current folder location on your Mac.

    Launching a Terminal Window in the Current Folder on a Mac

    You do not need a third-party app to get the job done. All you need to do is visit the Preferences panel, tweak a few settings here and there, and you will be all set.

    1. Click on the Apple logo in the top-left corner on your Mac, and select “System Preferences…” You will be taken to the Preferences panel on your Mac.

    2. Click on “Keyboard” in the Preferences panel.

    3. Once in the Keyboard panel, click on the “Shortcuts” tab.

    4. In the Shortcuts panel, click on “Services” in the left-hand menu. Scroll down in the right-hand menu, and select the options that say “New Terminal at Folder” and “New Terminal Tab at Folder.” These options should be next to each other.

    Click on “none” next to “New Terminal at Folder,” and press a key combination on your keyboard to assign a new shortcut key to the feature. That way you will be able to launch a Terminal window using a shortcut key instead of pulling up the menu and selecting the option to launch one.

    5. Once you have enabled the options and assigned a keyboard shortcut, you can close the Preferences panel.

    6. Open the parent directory where your folder is located. Then single-click on the folder where you wish to launch a Terminal window, click on “Finder” followed by “Services,” and select “New Terminal at Folder.” Or you can simply press the keyboard shortcut that you assigned before.

    7. A new Terminal window should launch in the current folder location allowing you to play around with the local files in that folder.

    Launching a local instance of Terminal should now be easy for you. Should you ever wish to disable the feature, you can do so from the Preferences panel by just unchecking the boxes that you selected in the above steps.

    Conclusion

    If your work revolves around working with local files using Terminal, and you do not want to go through the hassle of providing full paths to the files, you can simply use the above workaround to have Terminal launched keeping your current folder as its current working directory.

    Mahesh Makvana is a freelance tech writer who’s written thousands of posts about various tech topics on various sites. He specializes in writing about Windows, Mac, iOS, and Android tech posts. He’s been into the field for last eight years and hasn’t spent a single day without tinkering around his devices.

    Источник

    7 simple ways to open Terminal on Mac

    Terminal is a handy tool for giving your Mac commands although many may be intimidated by it. After all, it’s not as easy as just typing in a sentence and your Mac responding. We have some articles listed below that can help you with common commands if you’re interested in learning to use Terminal or if you just want to enter a command or two.

    Either way, before you can use it, you have to open it, right? There are various methods for opening it; here are seven simple ways to open Terminal on Mac.

    One of the quickest and easiest ways to open Terminal on Mac is with Spotlight Search.

    1) If you have the Spotlight Search button in your menu bar, click it. Otherwise, you can use the keyboard shortcut Command + Space.

    2) Type in “Terminal”.

    3) You should see the Terminal application under Top Hit at the top of your results. Double-click it and Terminal will open.

    Open Terminal using Finder

    Open Finder or make sure that your menu bar is using Finder and not another application.

    1) Click Go > Utilities from the menu bar.

    2) In the Utilities folder that opens, double-click Terminal.

    Open Terminal using the Applications folder

    If you have a Finder window open, you can access Terminal from the Applications folder.

    1) Select Applications from the left side.

    2) Click the arrow to expand the Utilities folder.

    3) Double-click Terminal.

    If you have the Applications folder in your Dock like I do, you can open Terminal from there too.

    1) Click Applications in your dock.

    2) Select Utilities.

    3) Choose Terminal.

    Open Terminal using Launchpad

    You can open Terminal using Launchpad two ways, depending on if you have organized Launchpad a different way or not.

    By default, Launchpad contains a folder labeled Other that contains Terminal.

    1) Open Launchpad from your Dock or with the keyboard shortcut Fn + F4.

    2) Locate the Other folder and click.

    3) Choose Terminal.

    If you have arranged your Launchpad items differently and removed the Other folder, you can still find Terminal easily.

    1) Open Launchpad from your Dock or with the keyboard shortcut Fn + F4.

    2) Type “Terminal” into the search box at the top.

    3) When the Terminal icon displays, click it.

    Open Terminal using Siri

    Thanks to a helpful comment from one of our readers, there is one more super simple to way to open Terminal on Mac; using Siri.

    1) Click the Siri button from your menu bar or open Siri from your Applications folder.

    2) Using your microphone, simply say “Open Terminal.”

    Create a Terminal shortcut

    If you decide that you want to start using Terminal more often, creating a shortcut for it in your Dock is convenient.

    With the Terminal icon in your Dock already, from recently opening it, do the following.

    1) Hold Control and click the Terminal icon in the Dock or right-click it.

    2) Mouse over Options in the pop-up menu.

    3) Click Keep in Dock.

    Terminal commands and tips

    As mentioned above, here are some of our articles with commands you can use for Terminal that may come in handy.

    You can also head to the Terminal section of our website for additional tips and tutorials for Terminal.

    Wrapping it up

    Terminal is a terrific tool for doing things quickly on your Mac. And once you get the hang of it, and bookmark some useful commands, it’s not as intimidating anymore.

    Have you tried to use Terminal yet or are you interested in learning more about it so that you can use it? Let us know your thoughts below and if you have any tips you’d like to share with our readers for using Terminal, feel free to comment!

    Источник

    Читайте также:  Windows 10 возникла проблема при создании диска восстановления windows
    Оцените статью