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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 2, 2025

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

      June 2, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 2, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 2, 2025

      How Red Hat just quietly, radically transformed enterprise server Linux

      June 2, 2025

      OpenAI wants ChatGPT to be your ‘super assistant’ – what that means

      June 2, 2025

      The best Linux VPNs of 2025: Expert tested and reviewed

      June 2, 2025

      One of my favorite gaming PCs is 60% off right now

      June 2, 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

      `document.currentScript` is more useful than I thought.

      June 2, 2025
      Recent

      `document.currentScript` is more useful than I thought.

      June 2, 2025

      Adobe Sensei and GenAI in Practice for Enterprise CMS

      June 2, 2025

      Over The Air Updates for React Native Apps

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

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025
      Recent

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025

      Microsoft says Copilot can use location to change Outlook’s UI on Android

      June 2, 2025

      TempoMail — Command Line Temporary Email in Linux

      June 2, 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:

    Hostinger
    
    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

    Operating Systems

    You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

    June 2, 2025
    Operating Systems

    Microsoft says Copilot can use location to change Outlook’s UI on Android

    June 2, 2025
    Leave A Reply Cancel Reply

    Hostinger

    Continue Reading

    Agentic Workflows in Insurance Claim Processing

    Databases

    Running Windows on Linux? Yes, It’s Possible with Wine and Proton!

    Development

    GenCast predicts weather and the risks of extreme conditions with state-of-the-art accuracy

    Artificial Intelligence

    State-of-the-art video and image generation with Veo 2 and Imagen 3

    Artificial Intelligence

    Highlights

    Development

    Hackers Exploiting WP-Automatic Plugin Bug to Create Admin Accounts on WordPress Sites

    April 26, 2024

    Threat actors are attempting to actively exploit a critical security flaw in the WP‑Automatic plugin…

    CISA’s Latest Advisories Expose High-Risk Vulnerabilities in Industrial Control Systems

    April 3, 2025

    How to record a phone call on Android in 3 easy ways

    June 5, 2024

    This critically acclaimed debut indie game is an early game of the year contender, and you can play it on Xbox Game Pass right now

    May 5, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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