How does one locate a .zshrc file?
Asked Answered
Y

5

11

I used Homebrew to install Z shell (zsh) 5.0.7 on my Mac.

For the life of me, .zshrc is nowhere to be found. It is not in ~. Is is not in /etc or /etc/zshrc as they suggest here: http://zshwiki.org/home/config/files

Am I supposed to create it myself?

Yelp answered 3/11, 2014 at 21:12 Comment(1)
no ide about mac. maybe there's a skeleton version in /etc/skel or something, but generally the ~/.zshrc is just to override defauls compiled into the shell or set at the system level. if you don't have one, it's not the end of the world - create one and start writing.Finer
L
19

Sure. If it's not there already, create it yourself.

$ touch ~/.zshrc
Libriform answered 3/11, 2014 at 21:17 Comment(3)
Thanks a lot. I lost way too much time on that !Yelp
You can just search on the web for "sample .zshrc" instead of writing your own from the scratch.Shears
Where i should touch it?Preparedness
S
3

You can run the helper script zsh-newuser-install from the prompt, and it will walk you through the process to create an initial .zshrc in your home directory.

Singley answered 4/11, 2014 at 21:4 Comment(0)
S
1

As kyranjamie mentioned, you can create it using following command

$ touch ~/.zshrc

Example content of .zshrc file:

PATH=$PATH:/your_path_goes_here
Seadon answered 9/2, 2021 at 18:23 Comment(0)
I
0

In order to find any file on a Unix-based system, you can try the command:

$ locate filename

It should list all the paths where the corresponding file exists.

Instrumentalism answered 12/2, 2019 at 7:35 Comment(0)
C
0

In Unix based systems, touch command followed by name will create an empty file in the present directory.

the modification and access time of each file is also updated with the use of touch command.

In your case, to create .zshrc file, you can use the touch command as :

$ touch ~/.zshrc
Contemporary answered 3/1, 2022 at 18:31 Comment(1)
This comment does not add anything new on top of all the other touch FILE answers.Dragonet

© 2022 - 2024 — McMap. All rights reserved.