4 ms·
There's something in my environment that keeps creating a file called "-" in my home directory, and it's driving me crazy.
by zanchey 9y ago
There's something in my environment that keeps creating a file called "-" in my home directory, and it's driving me crazy.
- jovial_cavalier 9y agoBy convention, when a unix program is passed "--" it means there are no more flags being passed. Try the following: $ rm -- -
- ConfucianNardin 9y agoThis will not work with all rm implementations, in which case you can fall back to: rm ./-
- zanchey 9y agoOh, I can remove it... And a few hours or days later it's back!
- jovial_cavalier 9y agoOkay, you're gonna want to type $sudo crontab -e...
- codedokode 9y agoIt is better to write EDITOR=nano sudo crontab ... otherwise instead of edititng the crontab you will be solving the problem of exiting vi.
- zanchey 9y agoAll the interest encouraged me to dig in and find it, and it turned out to be in one of zsh's many startup scripts.
- jsymolon 9y agolist the file showing inode number, rm by that particular inode.
- RHSeeger 9y agoOpen the parent directory with emacs and you can use it to delete the rogue directory/file. Admittedly, there's easier ways for a "-" named file, but its a good solution to know since you can use it to delete even the most difficult filenames.