Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 1, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 1, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 1, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 1, 2025

      7 MagSafe accessories that I recommend every iPhone user should have

      June 1, 2025

      I replaced my Kindle with an iPad Mini as my ebook reader – 8 reasons why I don’t regret it

      June 1, 2025

      Windows 11 version 25H2: Everything you need to know about Microsoft’s next OS release

      May 31, 2025

      Elden Ring Nightreign already has a duos Seamless Co-op mod from the creator of the beloved original, and it’ll be “expanded on in the future”

      May 31, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Student Record Android App using SQLite

      June 1, 2025
      Recent

      Student Record Android App using SQLite

      June 1, 2025

      When Array uses less memory than Uint8Array (in V8)

      June 1, 2025

      Laravel 12 Starter Kits: Definite Guide Which to Choose

      June 1, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025
      Recent

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025

      Le notizie minori del mondo GNU/Linux e dintorni della settimana nr 22/2025

      June 1, 2025

      Rilasciata PorteuX 2.1: Novità e Approfondimenti sulla Distribuzione GNU/Linux Portatile Basata su Slackware

      June 1, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Operating Systems»Linux»How to delete a file whose name begin with “-” dash

    How to delete a file whose name begin with “-” dash

    January 20, 2025

    Today, I found a file on my server named -config.ini that starts with a hyphen. It seems someone created it as a backup. The problem is, the starting hyphen is treated as a command-line option, making it tricky to delete. If you’re facing the same issue, don’t worry—this guide will show you how to remove it safely.

    Files with a “-” at the beginning of their name can be removed using the rm command with additional care since the - is interpreted as an option by most Unix commands.

    Delete file name begin with hyphen

    Here’s how you can safely remove such files using -- to stop option parsing

    
    rm -- -config.ini
    
    

    The -- tells rm to stop interpreting anything that follows as an option, treating -config.ini as a file name.

    Using Relative Path

    Another way is to specify the file using its relative or absolute path:

    
    rm ./-config.ini
    
    

    This approach works because the ./ explicitly indicates the file in the current directory.

    Confirm Before Deleting

    If you’re not sure and want to double-check the file before deleting:

    
    ls -- -config.ini
    
    

    Conclusion

    Deleting files that start with a hyphen may seem tricky at first, but it’s actually quite simple when you know the right steps. By using the methods in this guide, you can safely remove such files without any trouble. I hope this helps you solve the problem easily!

    The post How to delete a file whose name begin with “-” dash appeared first on TecAdmin.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous Article10 Reasons You’re Not Closing the Deal in Your Job Search (Free Download)
    Next Article Benvenuti nell’era ZombieOps: Microsoft voleva uccidere .NET 6.0 e TuxCare (AlmaLinux) lo zombifica con supporto a vita

    Related Posts

    Linux

    Photobooth is photobooth software for the Raspberry Pi and PC

    June 1, 2025
    Linux

    Le notizie minori del mondo GNU/Linux e dintorni della settimana nr 22/2025

    June 1, 2025
    Leave A Reply Cancel Reply

    Hostinger

    Continue Reading

    The best Samsung Galaxy S25 cases of 2025

    News & Updates

    Efficient Text Processing in Linux: Awk, Cut, Paste

    Learning Resources

    Utah Student Gives Hackers False Information to Thwart Phishing

    Development

    CVE-2025-4131 – WordPress GmapsMania Stored Cross-Site Scripting

    Common Vulnerabilities and Exposures (CVEs)
    GetResponse

    Highlights

    How to Successfully Market Your React Native App After Launch📣

    April 18, 2025

    Post Content Source: Read More 

    MVP vs. MVE: Choosing the Right Path for Digital Product Success

    January 23, 2025

    ExTiX – Ubuntu-based Linux distribution

    January 16, 2025

    Novità in arrivo per KDE Plasma: Scopri le funzionalità di Plasma 6.3 e 6.4

    January 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.