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 8599481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:24:26+00:00 2026-06-12T01:24:26+00:00

Possible Duplicate: How can I use inverse or negative wildcards when pattern matching in

  • 0

Possible Duplicate:
How can I use inverse or negative wildcards when pattern matching in a unix/linux shell?

I’ve read the man page for ls, and I can’t find the option to list all that do not match the file selector. Do you know how to perform this operation?

For example:
lets say my directory is this:

> ls
a.txt b.mkv c.txt d.mp3 e.flv

Now I would like to do something that does the following

> ls -[SOME_OPTION] *.txt
b.mkv d.mp3 e.flv

Is there such an option?

If not, is there a way to pipe the output of ls to another function (possibly sed) that shows only the ones that I would like?

I don’t know exactly how to do this, but I’m imagining it would be something like:

> ls | sed [SOMETHING] 

I really should learn how to use sed,awk,and grep, but I keep getting stuck at understanding how to write the regexes. I understand the concept of regular expressions clearly, but I get confused between regexes that use different syntax.

Any help would be much appreciated!

EDIT:

I forgot to mention that I am running Mac OS X, so the functions may be slightly different from the ones discussed in other answers for the unix/linux shell (hence some of my confusion with sed,awk,and grep).

  • 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-12T01:24:27+00:00Added an answer on June 12, 2026 at 1:24 am

    this may be help you

    ls --ignore=*.txt
    

    It will not display the .txt files in your directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What can you use Python generator functions for? I tried to read
Possible Duplicate: How can I use Perl to grab text from a web page
Possible Duplicate: Can we use any other TAG inside <ul> along with <li>? Or
Possible Duplicate: How can I use a string with the same name of an
Possible Duplicate: Rename Oracle Table or View I know you can use ALTER TABLE
Possible Duplicate: Escape @ character in razor view engine how can i use '@'
Possible Duplicate: Can I use ASP.NET MVC together with regular ASP.NET Web forms Let's
Possible Duplicate: How can I use a carriage return in a HTML tooltip? Currently
Possible Duplicate: How can I use the Google App engine bulkloader to back up
Possible Duplicate: How can one use multi threading in php applications Does anybody know

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.