For the operation of & quot;-& quot; in the Linux File Name-general Linux technology-Linux programming and kernel information, see the following for details. In Linux, "-" has a special meaning. For example, adding "-" to the end of a command indicates that "-" is followed by an option. However, there are three methods to create a file with the name "-". For example, to create a file "-":
1. cd.>-
2. vi ---
3. echo "">-
You can create a "-a" file in the current directory by using the preceding three methods. Of course, you can create a new file using other methods. It is troublesome to delete "-a". If you enter rm-a, the system will prompt you:
Rm: Invalid option --
Run 'rm -- help' to obtain more information.
You can delete an object in two ways:
1. rm./-
2. rm ---
You don't need to change the name. Basically, you can add "--" before the file name to indicate the escape characters!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service