This question already has an answer here:

I want to keep all .z files of zsh under a directory. Is there a way to do that, if yes, how ?

The two files I see are -

 $ ls .z
.zcompdump  .zshrc

Could there be anymore. Could I just put a directory, call it .zsh and dump these files in it or would there be something more than that. I have no idea what .zcompdump is supposed to do -

A listing of the contents inside gives me this -

$ head .zcompdump
#files: 823 version: 5.3

'-' '_torsocks'
'.' '_source'
'5g' '_go'
'5l' '_go'
'6g' '_go'
'6l' '_go'
'8g' '_go'

If I'm not wrong, it seems to be some sort of completion (similar to what bash-completion did) or am I reading it wrong.

Looking to know more.

Update - This is what I have done -

/etc/zsh $ tail zshenv          
# output or assume the shell is attached to a tty.
# Global Order: zshenv, zprofile, zshrc, zlogin

if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]
    export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

export ZDOTDIR="/home/shirish/.zsh/"

Then in /home/shirish -

/home/shirish $  mv .zcompdump .zsh/
/home/shirish $ mv .zshrc .zsh/

Then I went to .zsh/ expecting the two dot files to appear there but didn't see them -

/home/shirish/.zsh $ ls -lh 
total 0

Am confused by what went wrong.

marked as duplicate by jasonwryan, GAD3R, don_crissti, Eric Renouf, Anthon Dec 24 '16 at 14:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • It is a duplicate but not quite as I actually got some more information about what zdotdir does among other things. The other answer didn't have this explained well. – shirish Dec 23 '16 at 21:29

I think the best way, if you are root on the machine, would be to put the following your your /etc/zshenv file:

export ZDOTDIR="/path/to/where/you/want/zsh/files"

To verify that Debian does read/process the /etc/zshenv file to a "man zsh" on the system and look in the FILES section of the man page. If so, and if that file does not exist, then you can create it.

  • there is no /etc/zshenv file. This is a file I will have to create ? – shirish Dec 23 '16 at 20:09
  • actually it sits in /etc/zsh/zshenv – shirish Dec 23 '16 at 20:18
  • See my updated question, maybe the above I did is correct or not, does it seem correct ? – shirish Dec 23 '16 at 20:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.