Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Angry Can not delete file that starts with dashes


    I had a big problem! I'm a confident user of linux but today I've probably encountered a bug of the system.There are 2 files in the folder (not advertising these sites, I downloaded the music):
    Code:
    '-flejta_(mp3CC.com)(1).mp3'
    '-flejta_(mp3CC.com).mp3'
    I tried to move the file:
    Code:
    mv '-flejta_ (mp3CC.com) (1) .mp3' flejta.mp3
    mv: invalid key - "l"
    With the command "mv --help" you can get more information.
    I tried to delete the file:
    Code:
    rm '-flejta_ (mp3CC.com) (1) .mp3'
    rm: invalid key - "l"
    Try "rm ./'-flejta_(mp3CC.com )(1).mp3 '" to delete the file' -flejta_ (mp3CC.com) (1) .mp3 '.
    With the "rm --help" command, you can get more information.
    I used programming:
    Code:
    select i in *; do mv "$i" flejta.mp3 ;done
    And it gave the same mistakes.
    I do not use graphic managers, so do not offer me any.

  2. #2
    This, too, does not pass by the way
    Code:
    rm ./'-flejta_(mp3CC.com) (1) .mp3 '
    rm: can not be deleted './-flejta_(mp3CC.com) (1) .mp3': There is no such file or directory

  3. #3
    Linux Newbie CarterCox's Avatar
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    176
    OK, I'm using Android I did this:

    $ touch ./"-test"
    $ ls
    -test Alarms ...
    $ rm -rf ./"-test"
    $ ls
    Alarms ...

    So, I don't know what's happening on your end, but erasing files with dashes in the beggining can be done...

    Sent from my Moto G Play using Tapatalk
    "My common sense is tingling."

  4. $spacer_open
    $spacer_close
  5. #4
    VeryUserLinux, you need to learn to read. it's telling you what to try:
    Quote Originally Posted by VeryUserLinux View Post
    Code:
    Try "rm ./'-flejta_(mp3CC.com )(1).mp3 '" to delete the file' -flejta_ (mp3CC.com) (1) .mp3 '.
    Tapatalk: Kill it with fire!
    How to ask smart questions | Don't be a Help Vampire | How to Use Code Tags
    You can post a link by removing "http://www." from it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •