bash: getting rid of '.' and '..' when looping over files that begin with '.' in a folder

Posted by TheOsp on Stack Overflow See other posts from Stack Overflow or by TheOsp
Published on 2010-03-31T02:41:42Z Indexed on 2010/03/31 2:53 UTC
Read the original article Hit count: 273

Filed under:
|

I want to loop over the files that begin with '.' in directory x (x might be any path):

$ for file in x/.*
> do
>     echo -n $file" "
> done
x/. x/.. x/.a x/.b

What is the best way to get rid of x/., and x/.. ?

© Stack Overflow or respective owner

Related posts about bash

Related posts about best-practices