0

I am on linux, and want to create a directory called !? in a flash drive formatted as FAT32. No matter what I try, whether it be GUI or mkdir, I cannot create a directory called !?. However, I can do it in other places, such as my home directory. Why can't I do this on a flash drive??

2 Answers2

1

You have to use an escape character before the ! symbol.

In order to make your directory !? you need to write the command as mkdir \!? (with no space between the \ and !) or as mkdir '!?' (single quotes, not double).

Normally, I believe ! is used to reference events. I honestly don't know a whole lot about it. I just know how to make your directory by using the escape character, so the shell knows to interpret that character literally.

grawity
  • 501,077
DrZoo
  • 11,391
1

In this table on Wikipedia there is "allowable characters in directory entries" column. The entry for FAT32 states:

[…] except NUL, " * / : < > ? \ |

The chosen name !? contains ? which is not allowed. Choose another name or another filesystem. Note while ? is technically possible in NTFS, it may be problematic in Windows, so NTFS is not necessarily a good choice if you need this particular directory name.