Re: bash, grep, and regular expressions
From: Michael Marsh (michael.a.marsh_at_gmail.com)
Date: 02/18/05
- Previous message: harshal: "Re: how to install kde?"
- In reply to: Freddy Freeloader: "Re: bash, grep, and regular expressions"
- Next in thread: Justin Guerin: "Re: bash, grep, and regular expressions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 13:22:57 -0500 To: debian-user@lists.debian.org
On Fri, 18 Feb 2005 09:56:29 -0800, Freddy Freeloader
<fredddy@cableone.net> wrote:
> ls -al | grep -e ^d | grep -e '\<[^.][a-z]'
This is most likely matching the user and group names, which indeed do
not start with a dot and most likely begin with lowercase letters.
The date shouldn't match because it generally starts with a capital
letter, so you can try changing "ls -al" to "ls -aln" to get numeric
IDs, and see if this works.
You might try
ls -al | grep -e ^d | grep -e '\<[^.][^[:space:]]*$'
which will force grep to look at the last word in the line.
Note that this might have problems with filenames that contain spaces,
and will have problems with symlinks.
-- Michael A. Marsh http://www.umiacs.umd.edu/~mmarsh -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: harshal: "Re: how to install kde?"
- In reply to: Freddy Freeloader: "Re: bash, grep, and regular expressions"
- Next in thread: Justin Guerin: "Re: bash, grep, and regular expressions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|