FG
💻 Software

How do I remove a file in Linux whose name looks like it's ONLY a hyphen, as in "-"

Fresh7 days ago
Mar 15, 20264759 views
Confidence Score0%
0%

Problem

I've tried Gave Perl a shot ...and... Any assistance would be much appreciated, wise folks.

Error Output

rm -- -
rm "-"
rm "\-"
rm \-

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I remove a file in Linux whose name looks like it's ONLY a hyphen, as in "-"

Low Risk

This used to be posted in the Usenet FAQs for Unix—I see it is in the GNU Core Utility FAQs. There were at least five different methods, but this works well: If a filename contains untypeable characters, then use: The flag asks for confirmation for …

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment