In order to rename a file using Mac Terminal make use of the mv (move) command.
Example:Suppose I have a file name myfile.txt on the Mac Desktop and I want to rename it to myfile_2020.txt then below are the steps,
- Open Mac Terminal,
- Move to the Desktop: cd ~/Desktop
- Now to rename the file run the mv command,
Syntax:mv current-file-name new-file-name
% mv myfile.txt myfile_2022.txt
- The file will be renamed with myfile_2022.txt


Before renaming the file

After renaming the file
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to MacOS,
- How to Display Analog Clock on Mac Menu Bar
- Shutdown Mac Terminal Command
- How to know the Serial Number of MacBook on macOS Ventura 13.0
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing
- [fix] How to Show file extensions on all files on Mac
- How to install Zoom Add-in to Outlook (Mac)
- How to turn off Stage Manager - macOS Ventura
- Fix - Xode - Internal logic error: Connection was invalidated
- How to do calculations in Mac Terminal
- How to delete a Page in Microsoft Word File on Mac (macOS)
- How to Refresh Mac Desktop
- How to install Java on macOS [Big Sur]
- How to Disable Mac Terminal Bell Sound
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to Uninstall Brew on Mac
- Find your macOS version
- Change TextEdit File Encoding
- AppleScript Example with TextEdit
- How to install homebrew (brew) on M1 Mac
- How to Find File and Directory Size in Mac Terminal
- How to open new tab in Sublime Text Editor [macOS]
- How to list all users in Mac Terminal
- Turn off Auto-Capitalization on macOS Ventura 13
- How to check Command Line Tools Version [Updated for Ventura]
- Change Current User Password using Mac Terminal Command
More Posts:
- How to copy Chrome alert popup text to clipboard - Chrome
- Deep Dive: Why avoid java.util.Date and Calendar Classes - Java
- SharePoint Server 2016 IT Preview Deprecated Removed features - SharePoint
- How to restart WiFi using Crosh Terminal (ChromeOS Chromebook) - Chrome
- 12 August - International Youth Day celebrated worldwide - News
- Teams - You're offline. Messages you send while offline will be sent when you're back online - Teams
- Install Docker on Mac using brew cask - Docker
- Sorting an array using Bubble Sort in Python Programming - Python