Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I want to see the list of files and directories, but don't want to see the ones that end with a specific pattern. E.g. I have a big directory ...
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12

    [SOLVED] ls filter negate

    Hi,
    I want to see the list of files and directories, but don't want to see the ones that end with a specific pattern. E.g. I have a big directory and some files are normal outputs and some are error outputs (ending in .err). If i want to see the error files I can simply say: ls *.err, but how can I negate that (show me anything but the ones ending in .err)

    Thanks,
    Mike

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Use the --hide=pattern option to the ls command. Example:
    Code:
    ls --hide=*.err
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12
    yes it worked. Thanks.

Posting Permissions

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