How to fix invisible file name?

5

1

How do I fix an invisible file name?

I can open it in Notepad, and it shows the filename as .gitignore, but it shows up like this:

Icon

Google gives me tutorials on how to accomplish this, but I want the inverse.

LRNAB

Posted 2014-07-12T10:06:44.117

Reputation: 53

1Have you tried to rename the file? – Ĭsααc tիε βöss – 2014-07-12T11:28:51.627

5Can you clarify what you mean by fixing? As pointed out by the answers, the filename only has an extension and you have a setting active to hide known extensions. Showing all extension gives your icon a name, but I'm not sure that is a "fix" in your books, because technically speaking, nothing is broken. Also, do note that if this file is located on a network share running linux, the file will be hidden in addition, because files starting with a . are samba's way of saying the file is marked as hidden. – LPChip – 2014-07-12T13:21:34.113

3How is this not a duplicate 5 years after Super User was launched? – Peter Mortensen – 2014-07-12T13:57:19.373

Lol, isn't Windows great. For some reason, I'm hoping you're not trying to push to that repository (to which this file belongs, assuming there is a remote branch). I've seen too many broken files from Windows users (usually broken linebreaks and encoding, causing all kinds of problems). No offense. – basic6 – 2014-07-12T15:22:36.937

@basic6 None taken. No the files are alright to push. – LRNAB – 2014-07-12T16:25:50.990

Answers

9

I suspect it's because it's a "known extension" and you have those hidden.

Open Windows Explorer and go to Organize => Folder and search options => View tab => untick Hide extensions for known file types.

GIF showing process

Bob

Posted 2014-07-12T10:06:44.117

Reputation: 51 526

Would never think that it's the whole name understood as a name extension :) – Ruslan – 2014-07-12T14:51:37.677

9I wish MS would stop making this "feature" on by default. It's the first thing power users deactivate, and regular users never know they're opening a malware called harmless text file.txt.exe, because they don't see the .exe extension. – Nolonar – 2014-07-12T19:02:36.480

@Nolonar Better yet, it's on by default in the Server editions too. As for why anyone running Server would need or want it... well, don't ask me. – Bob – 2014-07-13T01:24:28.043

1

I second the suggestion of unchecking "Hide extensions for known file types".

This "feature" is not really useful, may be annoying (as in this case), and not really safe - figure out the classic scam virus attachment, an executable called SomeText.txt(.exe, hidden) with same icon of system .txt files!

Otherwise, you can rename the file from command prompt or from GUI using F2, but be sure no application is pointing to it or will not find it after renaming.

Dice9

Posted 2014-07-12T10:06:44.117

Reputation: 191

0

It's not invisible, it simply does not exist: this file only has an extension.

BTW, Windows does not allow creating such files from the file explorer, only command prompt.

Sparkler

Posted 2014-07-12T10:06:44.117

Reputation: 193

But it does allow making them via e.g. notepad. Just select "All files" in save dialog file type filter and enter the name like .testfile. – Ruslan – 2014-07-12T14:59:18.117

0

Windows doesn't really like filenames that start with a dit (.). I get around this by dropping the leading dot and supplying a .txt extension.

After uploading to the server I rename the file. Many SFTP clients allow you to do this with a right click. From a shell you would use something like:

mv getignore.txt .getignore

Tyson

Posted 2014-07-12T10:06:44.117

Reputation: 1 304

1Windows does really like them, it's just that some of default apps don't understand them. Such names are incompatible with Win32 subsystem of NTFS, but they are easily created and manipulated via POSIX subsystem. – Ruslan – 2014-07-12T14:53:01.233