Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:57:53+00:00 2026-06-10T21:57:53+00:00

On my computer running Ubuntu, I have a folder full of hundreds files all

  • 0

On my computer running Ubuntu, I have a folder full of hundreds files all named “index.html.n” where n starts at one and continues upwards. Some of those files are actual html files, some are image files (png and jpg), and some of them are zip files.

My goal is to permanently remove every single file except the zip archives. I assume it’s some combination of rm and file, but I’m not sure of the exact syntax.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:57:55+00:00Added an answer on June 10, 2026 at 9:57 pm

    If it fits into your argument list and no filenames contain colon a simple pipe with xargs should do:

    file * | grep -vi zip | cut -d: -f1 | tr '\n' '\0' | xargs -0 rm
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one computer running ubuntu operating system. It is having a wifi router
I have three computers on my LAN, one running ubuntu , one running openSuse
I only have one computer (running OS X), and need to test in both
At work, I have a desktop computer running Ubuntu 11.04 with VirtualBox installed. I
I have a network of 100 machines, all running Ubuntu Linux. On a continuous
We have about 40 computers running identical hardware and software. They all run Ubuntu
I have development server (from google appengine sdk), running on my Ubuntu computer. I
This is in Java, cross platform and being debugged on a computer running Ubuntu
I've written a client-server application. There is one computer running the server application, and
We have a single computer with Windows7 Home Premium running with SQL Server 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.