Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DVDSP

macrumors regular
Original poster
Jan 6, 2003
239
0
Southwick, MA
I have 1 hidden file in a folder that I'd like to make unhidden. The file name starts with a period so I can not see it. Is there any way I can change the file name and make it visible?

Thanks,
 
open Terminal. type

mv /pathname/.foldername /pathname/newfoldername

where /pathname is the path to the folder and /foldername is obviously the folder itself. mv is the command for move which is also the command for "rename".

:)
pnw
 
Thanks Paul.

I followed your instructions and got this response from Terminal:

usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory

I don't know what that means (although it looks promising :))but the file did not change.
 
my guess is that you got some little detail mistaken... i just tested it by making a .test directory and changing it to 'test', worked perfectly. i haven't used unix much in years so i may be missing something.

can you pm me the command exactly as you entered it? maybe i can help you troubleshoot if i see the command exactly...

:)
pnw
 
If one of the directories has a space in it, you'll need to precede the space with a backslash. For example, if the folder is My Stuff, you'd need to type it as My\ Stuff.
 
Being a unix person, I'm all for the command line method, but perhaps using the Finder would be easier for some. :)

To do this in the Finder, follow these steps:

1. Navigate to the folder that contains the hidden file/folder (its parent folder).
2. Hit Command-Shift-G, or Go menu -> Go to Folder...
3. Type in the name of the hidden folder, with the dot.
4. Now hit Command-I or File menu -> Get Info.
5. Under Name & Extension, rename it! Then close the little popup.
6. Command-Option-Esc to relaunch Finder (otherwise it still thinks the renamed folder is hidden).

That should do it.

Edited to remove some unecessary steps. :p
 
Also on a related note, you can see all files (hidden ones included) in terminal using the -a tag on the ls command (list command). Just type ls -a in the terminal and you should see 'em all!
 
I just realized that my original post may have been confusing. I wish to view a hidden file, the folder it is in is not hidden. Sorry if I misled anyone, but that's probably why I'm not getting anything to work.

Originally posted by whocares
Also on a related note, you can see all files (hidden ones included) in terminal using the -a tag on the ls command (list command). Just type ls -a in the terminal and you should see 'em all!

I tried this and basically could see everything in my Home folder, how can I get it to work for items not in that folder and then also rename that file?

Thanks again everyone,
 
Originally posted by DVDSP
I tried this and basically could see everything in my Home folder, how can I get it to work for items not in that folder and then also rename that file?

Thanks again everyone,

My methods uses the terminal, sorry.

1. Go to the desired folder:
in terminal type cd
This will automatically take you to your home folder (if you're already there, skip this line ;))
Enter cd folder1/folder2/folderx
where folders 1, 2 , x, ... are the path to the desired folder. For example if it's in a folder name "texts" in your Documents folder, the copmmand is cd Documents/texts/

2. To display all files (hidden ones included), use the list command
ls -a

3. To rename a hiddel file called .file_name use the move command:
mv .file_name file_name
This will in essence remove the period in front of the name, thus making it visible. You can obviously change its name also:
mv .old_name new_name

Hope this is clearly and works for you.

[edit]
This supposes that the file is somewhere within your Home folder (the file is in a folder, this folder in turn being in the Home folder). If the file is somewhere else, you have to start in the root folder and work you way down to the file. To get to root folder use cd /
Make sure you have sufficient privileges if this is the case!
[/edit]
 
Alright, I'm getting somewhere now. I followed your instructions and was able to view the file but when I tried to rename it I got this message again:

usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory

The name of the file has spaces in it so I tried again replacing the spaces with \ but then I got a 'no such file or directory' message.

Any other ideas?
 
I think mv is telling you that it didn't see exactly two arguments.

Try again, but put both filenames within double quote marks and don't use any backslashes, i.e.,
Code:
mv ".old file name" "new file name"
Make sure you have at least one space before the first and third double quote marks, i.e., before each filename.
 
Originally posted by DVDSP


The name of the file has spaces in it so I tried again replacing the spaces with \ but then I got a 'no such file or directory' message.

Any other ideas?

You don't replace the spaces by a backslash but by a backslash + a space. For example, a folder apperaing as My Folder in the folder (no quotes) will appear as My\ Folder in the terminal (note the space between \ and Folder!). The backslash is there as an "escape" symbol, so that the system knows that the following space is still part of the name (and not the space before the new name).

On a relate topic, try autocompletion with the Tab key, as you type cd My to change directory, hit tab and the folder name will autocomplete to My\ Folder if it's the only folder starting with the string My . Very nifty.
 
Thanks for your input everyone. The quotes were all I needed so now I can see that file. Yeah!

Also, that autocomplete is very handy. The original file name was about 23 "words" long, all numbers and seemingly random letters, I was typing it all in every time. The last time I used the autocomplete and saved myself all the extra typing. Nice.

Just out of curiosity, if I cd Desktop/folder1 but then I want to go to a different folder that is also on the Desktop (or even somewhere else) how do I go 'backwards' to get out of that folder. I mean, once I'm in folder1 I seem to be stuck there unless I log out and start a new session.

By the way, obviously I don't use the command line too often. Where is a good resource to learn a little more?

Thanks again,
 
This is my way...

When I want to see hidden files, I go to /username/library/preferences and open the com.apple.finder.plist file and look for "showallfiles" set that to ON, save and relaunch Finder... maybe it's a longer way but it's an alternative ;)
 
Originally posted by DVDSP
Just out of curiosity, if I cd Desktop/folder1 but then I want to go to a different folder that is also on the Desktop (or even somewhere else) how do I go 'backwards' to get out of that folder.

cd .. to go up one folder (double-period is the name of the parent directoty, it appears with a ls -a ).
 
Right, so you can use two steps:
Code:
cd ..
cd folder2
or combine it into one step
Code:
cd ../folder2
 
To continue along with Doctor Q, to go back two folders:
Code:
cd ../..
and to go back to folders and enter a new folder:
Code:
cd ../../folder

You get the idea :p
 
Originally posted by irmongoose
Agh... all this Unix stuff is confusing. Just use TinkerTool to enable hidden file viewing in the Finder.



irmongoose

I have to second that. While going into the Terminal can be fun and informative, it's much easier if you just download TinkerTool and have it show all hidden files (and yes I know you can do this by a command in the Terminal :rolleyes:).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.