Mac OS X doesn't allow to name files starting with a dot. How do I name the .htaccess file?

后端 未结 8 1460
清歌不尽
清歌不尽 2021-01-30 03:44

As mentioned in the title, Mac OS X doesn\'t allow me to name files starting with a dot ( . ). But, I need an .htaccess file. Or, better, how do I use an htaccess file in Mac OS

8条回答
  •  星月不相逢
    2021-01-30 04:38

    You can add an alias in your startup script file to make the command shorter. Usually this is .bashrc, .bash_login or .profile file in your home directory.

    alias ondot='defaults write com.apple.finder AppleShowAllFiles -bool YES; killall Finder'
    alias ofdot='defaults write com.apple.finder AppleShowAllFiles -bool NO; killall Finder'
    

    Now you can just type ondot to show hidden files. and ofdot for hiding hidden files

提交回复
热议问题