Fix - cd: no such file or directory: .zshrc

If you are trying to cd - change the directory to the .zshrc profile file using the Terminal, you will get the error - "no such file or directory: .zshrc" if you do not provide the correct path to it.

Example:

% cd .zshrc 

cd: no such file or directory: .zshrc

Even if you provide the correct path for the .zshrc file which is under the user home directory, still you will get an error,

 % cd ~/.zshrc

cd: not a directory: /Users/c2ctech/.zshrc
cd- no such file or directory- .zshrc

Fix:

This is because .zshrc is not a directory but a file. You need to make use of a text editor like vi or nano to open it, or make use of cat command to display the content of this file.

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!