💾 Archived View for gerikson.com › gemlog › lobsters-drafts › rm-rf.gmi captured on 2024-06-16 at 12:46:58. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

The occasional geminer - an artisanal, handcrafted gemlog

↑ latest entries

rm —

One guy said his preferred method was to cd up and nuke the whole directory.

Wow.

The method I learned, and used when helping my coworker, was the `—` option to `rm`.

Nowadays `rm` seems to detect this and gives a help text:

    $ rm -testfile
    rm: invalid option — ‘t’
    Try ‘rm ./-testfile’ to remove the file ‘-testfile’.
    Try ‘rm —help’ for more information.

This option is included in this article

https://kb.iu.edu/d/abao

which is high up on the search result for “linux remove file starting with dash”.

Then there’s this “creative” solution:

There are some characters that you cannot remove using any of the above methods, such as forward slashes, interpreted by Unix as directory separators. To remove a file with such meta-characters, you may have to FTP into the account containing the file from a separate account and enter the command:
`mdel`
You will be asked if you really wish to delete each file in the directory. Be sure to answer n (for no) for each file except the file containing the difficult character that you wish to delete.

────────────────────────────────────────────

✽ Sunday, 2019-03-10

→ more posts in the ‹lobsters-drafts› category

About this category: “Sometimes I post to lobste.rs, sometimes I write angry rants that end up here but not there”

Copyright © 2018 - 2022 Gustaf Erikson

Main page for this gemsite

[This Page Viewed Best In Any Gemini Client]