UGU: Unix Guru Universe - Unix Tip #4568- September 13, 2017
- Home : Help
: Today's Tip
Unix Tip #4568- September 13, 2017
-------- REMOVE THE DASHES
Have you ever accidentally created a file beginning with '-'?
It happens often by mistake and from the first look it seems
like you can't delete the file (rm thinks the initial - is an
option, and doesn't recognize the file).
The simple, quick way around this is the -- option to rm.
Say you had the file ---hey in the current directory:
$ ls ---hey
/bin/ls: unrecognized option `---hey'
Try `/bin/ls --help' for more information.
$ ls|grep hey
$ rm ---hey
rm: unrecognized option `---hey'
Try `rm --help' for more information.
$ rm -- ---hey
( ls also has an -- option: )
$ ls -- ---hey
/bin/ls: ---hey: No such file or directory
This tip generously supported by: email@example.com
NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
LAST 5 TIPS
- SEPARATE SHELL COMMAND HISTORY FILES
- SHARING STDIN/STDOUT ON 2 TERMINALS
- SET REMOTE DISPLAY QUICKLY
- MULTI-SYSADMIN MONITORING
- ABBREVIATE IN VI
I want to
and get a UGU Tip everyday.
I want to
and NOT get a UGU Tip everyday.
If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
Copyright 1994-2018 Unix Guru Universe