-1

Can't find many resources on this. With Mac OS Catalina, the default shell switched from bash to zsh.

I want to edit .zshrc so I can add some ssh shortcuts (and avoid having to copy/paste my ssh command from a text file every morning). I can't find .zshrc anywhere. Do I have to create it? Am I headed in the wrong direction? Any help appreciated.

  • You can simply create `.zshrc` if it doesn't already exist. However, depending on what exactly you mean by "ssh shortcut", you may want to add some configuration to your `.ssh/config` file instead. This isn't necessarily something the shell needs to be concerned with. – chepner Sep 24 '20 at 12:47
  • @user3109112 : Files don't spring into existence magically. For bash, you had to create your startup files too. Just do i.e. `nano ~/.zshrc`. Most likely, you also want to configure your prompt etc. – user1934428 Sep 24 '20 at 14:57
  • @user1934428 It's not unreasonable, though, to think that `.zshrc` *does* exist, and you just can't find it. The key here is that the shell itself considers the file optional; it is not an error for it not to exist, and if you want to use it, you need to create it first. – chepner Sep 24 '20 at 15:00
  • @chepner : Are there **any** files I can assume to exist, in particular under my home directory? Of course each directory has the entries of `.` and `..` which don't count, but otherwise, why would a file exist, unless me or a kind sysadmin has created it? – user1934428 Sep 24 '20 at 15:05
  • Probably not, but there aren't any files that *need* to exist. The type of resource files under discussion are either optionally used when present, or created by the program that uses it when it can't find it. – chepner Sep 24 '20 at 16:07

1 Answers1

0

.zshrc should be under /Users/username/

Try ls -a in terminal if you haven't to show hidden files. If .zshrc isn't there, you need to make one.

CliffJ
  • 43
  • 7