I'm trying to create a hidden file and for some reason the command touch .fileName
doesn't work.
I made sure that my folder and file settings are set to - don't show hidden folders and files.
I'm working with windows10, and Hyper.is terminal.
Asked
Active
Viewed 1,464 times
0

aminography
- 21,986
- 13
- 70
- 74

Tom Lipshits
- 3
- 3
-
Please elaborate on what you mean by does not work? If you do a file listing with e.g. `ls -al` it will list also hidden files. – stephanmg Nov 06 '19 at 10:37
-
3winslow has not the same rules as unix about hidden files. In the micro$oft file systems there is a file attribute, while in unix there is not. – linuxfan says Reinstate Monica Nov 06 '19 at 10:39
-
@linuxfan: Oh yes, I somehow did not read Win10, my bad! – stephanmg Nov 06 '19 at 10:45
1 Answers
0
Windows doesn't care about files beginning with a dot. It just treats them like any old file. If you want to hide a file in Windows you must (also) change that attribute.
attrib +h path-to-file
You can run that from any cmd or PowerShell prompt. It may also work at a bash prompt, though I don't have one in front of me to test it. Using that dual method you can name your file .whatever and then add the above attribute and make it hidden to Windows as well. (Bash should treat the .whatever file as hidden regardless of the Windows attribute.)

JamesIsIn
- 181
- 1
- 6