
% cd ~/Library/Application Support/Sublime Text 3
cd: too many arguments
"cd: too many arguments" error occurs when you are trying to make use of the cd - change directory command to change your current working directory in the terminal or the command line.
Why this error
As the error says you are providing too many arguments to the command, while it excepts only one.
To know more about the syntax of this error let's take a look at its man page.
cd [-L|-P] [directory]
In the above example where our cd command failed we have provided
% cd ~/Library/Application Support/Sublime Text 3
So definitely the issue is that we have added spaces in the directory path that is treated as a next argument!
Possible Fixes: Step-by-Step
Fix 1: Surround the path with double quotes
% cd "~/Library/Application Support/Sublime Text 3"
Fix 2: Make use of backslashes to escape special characters
You may also get this error if the directory name has special characters like braces.
# cd My Dir (Important)
bash: syntax error near unexpected token `('
In such a case you can escape the special characters with backslashes
# cd My\ Dir\ \(Important\)/
Fix 3: Make use of tab completion
This is something that is highly recommended, while navigating to a directory using the cd command, always write some text pertaining to a directory and press the tab to autocomplete. It will automatically escape special characters for you!
Example as gif demonstration.
Have Questions? Post them here!
- Opening mac Terminal
- How to change default macOS Terminal Window size
- How to clear Mac Terminal screen
- Find Hostname of Mac running on macOS Ventura 13
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to switch from bash to zsh shell in macOS Terminal
- Limit scrollback rows in macOS Terminal
- How to Set Background Wallpaper on macOS 13 Ventura
- This operation couldnt be completed. Unable to locate a Java Runtime. [macOS]
- Encode or Decode Base64 String using Mac Terminal Command
- List of All Apple Silicon ARM Based M1/M2 Mac [updated Oct 2022)
- How to remove Siri from Menu Bar [macOS Big Sur]
- Must Know Homebrew Commands for Mac/Linux Users
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- 13.0 MacOS Ventura release date
- How to change the default location of Mac Screenshot
- How to set Out Of Office (OOO) on Outlook for Mac
- 30+ Zoom video communications application shortcuts for macOS
- How to install wget on macOS
- Mac turn dark mode on or off using terminal command
- Create Symbolic Link using Terminal Command
- Mac - How to Install VirtualBox
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to install homebrew (brew) on M1 Mac
- How to uninstall Microsoft Outlook on Mac
- Install Docker for Mac using Home-brew Cask - Docker
- [Fix] Restricted View permission level missing in SharePoint Online site library - SharePoint
- bash get year 2021 calendar - Bash
- Android Studio 4.2 Canary 1 now available - Android-Studio
- Fail to connect to camera service Android java RuntimeException - Android
- MySQL: Error Code: 1175 You are using safe update mode - MySQL
- How to place two div elements next to each other - CSS
- Enable Spellcheck in eclipse workspace - Eclipse