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.


% 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


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.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap