Linux Next interesting question (the file name begins with a dash)
This was an inadvertent discovery.
Under Linux, the file name contains - There is no problem, but if the file name is - as the first character, then it is more troublesome.
Problem Demo
Look here, the filename beginning with the dash appears to be immune to operations such as MV CP RM . With this feature you can create some cumbersome files or folders.
[Email protected]:~$ls-Python.md[email protected]-pc:~$MV-python.md5-python.mdMV: Invalid option--Ptry'MV--help' for Moreinformation. [Email protected]-pc:~$MV "-python.md" 5-python.mdMV: Invalid option--Ptry'MV--help' for MoreInformation.
Solutions
This is actually a good solution, the problem is because it will - as an option parameter identification, and cause the corresponding file cannot be found. The solution is to find a way to hide this.
MV 5-pythom.md
File name begins with a space
There is no intention to say too much here, the principle is the same. If the file name begins with a space, you must know the number of spaces.
Enclose the file name you want to manipulate in single quotation marks
For example, there is a file named "a" Note that the file name is three spaces plus one letter A. If you rename it, use the following command
mv ' A' new file name
Linux Next interesting question (the file name begins with a dash or a space)