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 [email protected]:/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
BUIR Repository :: Login
Capital One Transfer Partners Guide
Hotels Near 625 Smith Avenue Nashville Tn 37203
Tryst Utah
Tabc On The Fly Final Exam Answers
Tesla Supercharger La Crosse Photos
Chris wragge hi-res stock photography and images - Alamy
Athletic Squad With Poles Crossword
2022 Apple Trade P36
Kentucky Downs Entries Today
What is international trade and explain its types?
Osrs But Damage
Does Publix Have Sephora Gift Cards
Seafood Bucket Cajun Style Seafood Restaurant in South Salt Lake - Restaurant menu and reviews
今月のSpotify Japanese Hip Hopベスト作品 -2024/08-|K.EG
Fredericksburg Free Lance Star Obituaries
Dutch Bros San Angelo Tx
Jenn Pellegrino Photos
Extra Virgin Coconut Oil Walmart
10 Fun Things to Do in Elk Grove, CA | Explore Elk Grove
[Cheryll Glotfelty, Harold Fromm] The Ecocriticism(z-lib.org)
The Ultimate Guide to Extras Casting: Everything You Need to Know - MyCastingFile
Finding Safety Data Sheets
Saxies Lake Worth
Publix Near 12401 International Drive
Safeway Aciu
Robotization Deviantart
Remnants of Filth: Yuwu (Novel) Vol. 4
Yu-Gi-Oh Card Database
Mobile crane from the Netherlands, used mobile crane for sale from the Netherlands
1987 Monte Carlo Ss For Sale Craigslist
What Time Does Walmart Auto Center Open
Upstate Ny Craigslist Pets
Weekly Math Review Q4 3
Top-ranked Wisconsin beats Marquette in front of record volleyball crowd at Fiserv Forum. What we learned.
Reese Witherspoon Wiki
Lima Crime Stoppers
Craigslist Odessa Midland Texas
Truck Works Dothan Alabama
Xre 00251
Terrell Buckley Net Worth
Das schönste Comeback des Jahres: Warum die Vengaboys nie wieder gehen dürfen
Strange World Showtimes Near Marcus La Crosse Cinema
Jimmy John's Near Me Open
Verilife Williamsport Reviews
Grandma's Portuguese Sweet Bread Recipe Made from Scratch
Nkey rollover - Hitta bästa priset på Prisjakt
Tamilblasters.wu
Public Broadcasting Service Clg Wiki
Obituary Roger Schaefer Update 2020
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.