Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-15-2007
dkieran dkieran is offline
Registered User
 

Join Date: May 2007
Posts: 21
trying to list everything in a folder except . and ..

I want to list everything in a directory, including dotfiles (example .file1) except for the . and .. that are in every folder.
I'm guessing it's some sort of regular expression I need.
So far, I have come up with
ls -a | grep [^.]
That lists the .file1 file only (though I don't see why it should, as it indicate listed lines which start with . and the listings . and .. qualify for this)
However, when I create a file called ... and try this, it doesn't work.
Sponsored Links