Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 X without giving it a name starting with a dot?

I am running Mac OS 10.5.8 and XAMPP 1.7.3.

like image 206
Diego Favero Avatar asked May 05 '11 00:05

Diego Favero


People also ask

How do I list a DOT file on a Mac?

In Finder, open up your Macintosh HD folder. Press Command+Shift+Dot. Your hidden files will become visible.

Why does Mac make ._ files?

. _ files are created automatically by Mac OS X and contain metadata related to the accompanying file that was placed there by programs in the Mac.

What cant be used in OS X file name?

The names of files and folders in Mac OS X can use almost any character out of thousands of Unicode characters, which include symbols, arrows, and icons as well. There are only two characters you can't use: one is the colon (because it's used by the system).


2 Answers

You can't do this with the Finder. Open Terminal.app (Applications -> Utilities -> Terminal), and type:

> cd /path/to/directory/containing/htaccess > mv current_file_name .htaccess 

Example (do not take directory names or initial filename literally, of course):

terminal screenshot

like image 88
Matt Ball Avatar answered Sep 19 '22 04:09

Matt Ball


You can create files that begin with a "." if you can view hidden files.

Enter the following commands to show hidden files:

defaults write com.apple.finder AppleShowAllFiles -bool YES killall Finder 

When you're done enter these commands to hide them again:

defaults write com.apple.finder AppleShowAllFiles -bool NO killall Finder 
like image 20
Arkhaic Avatar answered Sep 18 '22 04:09

Arkhaic