12

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ulysse
  • 123
  • 1
  • 1
  • 4
  • 2
    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. – Marc B Nov 03 '14 at 21:14

5 Answers5

18

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

$ touch ~/.zshrc
kyranjamie
  • 995
  • 14
  • 26
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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

As kyranjamie mentioned, you can create it using following command

$ touch ~/.zshrc

Example content of .zshrc file:

PATH=$PATH:/your_path_goes_here
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rishabh Agrawal
  • 1,998
  • 2
  • 25
  • 40
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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
RachJain
  • 283
  • 1
  • 5
  • 14
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
Adesh Khanna
  • 172
  • 2
  • 9