Operations with "-" in Linux file names

Source: Internet
Author: User
In Linux, & quot;-& quot; has a special meaning for operations in the Linux file name, for example, adding & quot;-& quot; after the command; it indicates that options are followed. However, there are three methods to create a file with the name & quot;-& quot;. for example, to create a file & quot;-a & quot;: www.2cto. com1, cd. & gt;-a2 ..
The "-" operation in Linux with "-" in the Linux file name has special meanings. for example, adding "-" after the 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 "-a": www.2cto.com 1, cd.> -a 2, vi ---a 3, echo "">-a above three methods can all create a "-a" file in the current directory, of course, you can create other methods, which are not described here. It is troublesome to delete "-a". if you enter rm-a, the system will prompt you: rm: invalid option -- a. run 'rm -- help' to obtain more information. You can delete an object in two ways: 1. rm. /-a 2, rm ---a to change the name, basically adding "--" before the file name to indicate the escape character!
 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.