If Not True Then False

Linux Tip: How to handle a files with a dash as first character from command line - Comment Page: 1

Sometimes you maybe have to handle files with a dash (-) as first character from Linux command line. It can be difficult, because the script “thinks” the marks after the dash are parameters. So files which name begins with dash (-) can not be dealt with directly by typing the command and the file name, such as the following: less -file-with-a-dash-as-first-character Files which...
Tagged with:


Leave a Comment

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

Input your comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.


Many (all?) commands have “–” parameter, which means “end of parameters”. So you can use
command — -file-with-a-dash

reply Reply