The -- Option

If a file name happens to begin with a ‘-‘ then it would be impossible to use that file name as an argument to a command. To overcome this circumstance, most commands take an option -- ( the two hyphens written together) This option specifies that no more options follow on the command-line after -- and everything else must be treated as a literal file name.
For instance,

touch -- -stupid_file_name
This creates an empty file with name -stupid_file_name.
rm -- -stupid_file_name
This removes the file with name -stupid_file_name.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: