DEV Community

mich0w0h
mich0w0h

Posted on

Shell: How to manipulate dashed file

What I want to achieve

  • manipulate a dashed file in the shell
  • it can't be done the way it is because it's interpreted as an option command

Solution

Specify the file path like ./-.

In the case of creating a file named -, the command would be;

$ touch ./-
Enter fullscreen mode Exit fullscreen mode

As for opening a file, the command would be;

$ cat ./-
Enter fullscreen mode Exit fullscreen mode

References

Top comments (0)