Manage files in Terminal on Mac (2024)

Manage files in Terminal on Mac (1)

In Terminal, you can move and copy files locally or remotely using the mv, cp, and scp command-line tools.

Tip: It’s easier to move and copy files using the Finder. See Organize files in folders.

See Also
xcopy

Open Terminal for me

Move a file or folder locally

  • In the Terminal app Manage files in Terminal on Mac (2) on your Mac, use the mv command to move files or folders from one location to another on the same computer. The mv command moves the file or folder from its old location and puts it in the new location.

    For example, to move a file from your Downloads folder to a Work folder in your Documents folder:

    % mv ~/Downloads/MyFile.txt ~/Documents/Work/MyFile.txt

    You can also change the name of the file as it’s moved:

    % mv ~/Downloads/MyFile.txt ~/Documents/Work/NewFileName.txt

See the mv command man page.

Copy a file or folder locally

  • In the Terminal app Manage files in Terminal on Mac (3) on your Mac, use the cp command to make a copy of a file.

    For example, to copy a folder named Expenses in your Documents folder to another volume named Data:

    % cp -R ~/Documents/Expenses /Volumes/Data/Expenses

    The -R flag causes cp to copy the folder and its contents. Note that the folder name does not end with a slash, which would change how cp copies the folder.

See the cp command man page.

Copy a file or folder remotely

  • In the Terminal app Manage files in Terminal on Mac (4) on your Mac, use the scp command to copy a file or folder to or from a remote computer.

    scp uses the same underlying protocols as ssh.

    For example, to copy a compressed file from your home folder to another user’s home folder on a remote server:

    % scp -E ~/ImportantPapers.tgz username@remoteserver.com:/Users/username/Desktop/ImportantPapers.tgz

    You’re prompted for the user’s password.

    The -E flag preserves extended attributes, resource forks, and ACL information.

    The -r flag, which isn’t used in this example, causes scp to copy a folder and its contents.

See the scp command man page.

Helpful?

Thanks for your feedback.

Manage files in Terminal on Mac (2024)

FAQs

How do I list all files and folders in Terminal Mac? ›

Use the command line

For example, to see a list of files in your default folder, type the List command, ls , then press Return. When you're done, clear the window of the list by choosing Edit > Clear Screen.

How do I access files in Mac terminal? ›

To look at the contents of a text-based configuration file, use cat or less . Generally, you'll use less because it has more options (such as searching). To use less , enter the command name followed by the name of the file you want to view.

How do I manage files on a Mac? ›

You use Finder windows to organise and access almost everything on your Mac.
  1. See your stuff. ...
  2. Access everything, everywhere. ...
  3. Organise with folders or tags. ...
  4. Clean a messy desktop. ...
  5. Choose your view. ...
  6. Send files or folders. ...
  7. Share files or folders. ...
  8. Sync information between your Mac and other devices.

How to edit a file in a Mac terminal? ›

To edit a plain text file in Terminal, you can use a command-line text editor. For general-purpose work, it's easiest to use one of the text editors included with macOS. If you want to use a graphical text editor, use TextEdit (in Launchpad).

How do I navigate files and folders in Terminal? ›

Type pwd in the terminal and press Enter. pwd stands for “print working directory”. The output from this command tells you which folder is your current working directory. The ls command has additional options that can change how it functions.

How do you specify files and folders in Terminal on Mac? ›

The tilde character represents the home folder of the logged-in user. For example, to specify the Documents folder of the current user, enter ~/Documents. To specify another user's Document folder, use the short name preceded by the tilde (~) character—for example, ~jsmith/Documents.

How to go folder in terminal Mac? ›

Go to a folder by entering its pathname

As you type, matching folders appear. Type a slash (/) at the beginning of a pathname to indicate that the starting point is the top level of your computer's folder structure. Type a slash at the end to indicate that this is a path to a folder, rather than a file.

How do I give terminal access to folders on Mac? ›

Granting Terminal Full Disk Access in macOS
  1. Open your macOS Preferences to Full Disk Access. Click on the Apple icon in the top left of your menu bar and choose "System Preferences...". ...
  2. Unlock to allow changes. ...
  3. Add Terminal to the Full Disk Access list. ...
  4. Relock the padlock.

How do I open folders in terminal? ›

To open a directory in a terminal, you use the cd command to change your current directory. This essentially opens that folder and places you in it.

How do I see all files on my Mac? ›

On your Mac, click the Finder icon in the Dock to open a Finder window. Choose View > Show Path Bar, or press the Option key to show the path bar momentarily. The location and nested folders that contain your file or folder are displayed near the bottom of the Finder window.

How do I manage other files on my Mac? ›

How to clean up Other storage on Mac
  1. From your desktop, press Command-F.
  2. Click This Mac.
  3. Click the first dropdown menu field and select Other.
  4. From the Search Attributes window, tick File Size and File Extension.
  5. Now, you can input different document file types (. pdf, . ...
  6. Review the items and then delete them as needed.
Apr 17, 2024

Does Mac have a file manager? ›

The Finder icon looks like a blue smiling face; click the icon in the Dock to open a Finder window. You use Finder windows to organize and access almost everything on your Mac.

How do I edit an existing file in terminal? ›

To edit a text file in a Linux terminal, use a command-line text editor like Nano or Vim. or Vi . Type the editor's command followed by the file name, press Enter, make changes, and save. Nano users can use Ctrl + X, while Vim users can use :wq to exit after making the edits in the text file .

How to view a file in terminal mac? ›

In the Terminal app on your Mac, invoke a command-line editor by typing the name of the editor, followed by a space and then the name of the file you want to open.

Can you customize Mac terminal? ›

In the Terminal app on your Mac, choose Terminal > Settings, then click a settings pane: General: Set the profile for the startup window, for new windows and tabs, and choose the shell to use. Profiles: Create profiles to change how Terminal windows look.

How do I list all folders in Terminal? ›

Listing files and folders in the current directory

To see them in the terminal, you use the "ls" command, which is used to list files and directories. So, when I type "ls" and press "Enter" we see the same folders that we do in the Finder window.

How do I see all files and folders on Mac? ›

On your Mac, click the Finder icon in the Dock to open a Finder window. Choose View > Show Path Bar, or press the Option key to show the path bar momentarily. The location and nested folders that contain your file or folder are displayed near the bottom of the Finder window.

How do I list all files and folders in a directory? ›

Follow these baby steps:
  1. Press Windows + R.
  2. Press Enter.
  3. Type cmd.
  4. Press Enter.
  5. Type dir -s.
  6. Press Enter.
Mar 5, 2013

Top Articles
How to Track Someone Location With Phone Number for Free and Legally in 2024
Coinbase Global, Inc. (COIN) Statistics & Valuation Metrics - Stock Analysis
Evil Dead Movies In Order & Timeline
SZA: Weinen und töten und alles dazwischen
Caesars Rewards Loyalty Program Review [Previously Total Rewards]
Identifont Upload
Ross Dress For Less Hiring Near Me
Sam's Club Gas Price Hilliard
Snarky Tea Net Worth 2022
Giovanna Ewbank Nua
Anki Fsrs
Zoebaby222
2021 Lexus IS for sale - Richardson, TX - craigslist
More Apt To Complain Crossword
5 high school volleyball stars of the week: Sept. 17 edition
Truck Trader Pennsylvania
The Cure Average Setlist
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Violent Night Showtimes Near Amc Fashion Valley 18
Nevermore: What Doesn't Kill
Hermitcraft Texture Pack
Busted Campbell County
How your diet could help combat climate change in 2019 | CNN
Chaos Space Marines Codex 9Th Edition Pdf
Happy Life 365, Kelly Weekers | 9789021569444 | Boeken | bol
University Of Michigan Paging System
Olivia Maeday
Everything To Know About N Scale Model Trains - My Hobby Models
Tactical Masters Price Guide
Plasma Donation Racine Wi
Used Safari Condo Alto R1723 For Sale
Craigslist Dallastx
Kstate Qualtrics
Haley Gifts :: Stardew Valley
Vip Lounge Odu
The Boogeyman Showtimes Near Surf Cinemas
Otter Bustr
Housing Intranet Unt
Atlanta Musicians Craigslist
140000 Kilometers To Miles
Oppenheimer Showtimes Near B&B Theatres Liberty Cinema 12
Lonely Wife Dating Club בקורות וחוות דעת משתמשים 2021
Other Places to Get Your Steps - Walk Cabarrus
Carroll White Remc Outage Map
412Doctors
Bridgeport Police Blotter Today
Hdmovie2 Sbs
Who Is Nina Yankovic? Daughter of Musician Weird Al Yankovic
O'reilly's On Marbach
Ubg98.Github.io Unblocked
Cheryl Mchenry Retirement
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 6382

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.