Re: Homework Question: egrep and piping
From: Charles LaCour (nospam_at_lacour.homelinux.com)
Date: 12/30/03
- Next message: ynotssor: "Re: Homework Question: egrep and piping"
- Previous message: Tarvok: "Homework Question: egrep and piping"
- In reply to: Tarvok: "Homework Question: egrep and piping"
- Next in thread: ynotssor: "Re: Homework Question: egrep and piping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Dec 2003 01:28:00 GMT
Tarvok wrote:
> Hello, this is sort of a homework question, though its homework I
> assigned myself. I'm going through the last two chapters of a book
> which weren't covered in the class it was used in (Carolyn Z. Gillay's
> _Linux User's Guide_, if anybody cares), and I came across an activity
> I simply can't figure out the answer to.
>
> Here is the exact text: "Create an alias called lfdo that lists all
> the directories in only /mnt/floppy *not including* child directories,
> but does not list files. (Hint: remember egrep and piping.)
>
> Yes, the disk is mounted. Yes, I successfully created the alias in the
> previous assignment, which wasn't so complex. I don't think I
> understand egrep well enough to do this. Can anybody help?
>
>
> - Tarvok
Try aliasing the following command:
ls -l /mnt/floppy | egrep '^d'
The first character of the ls -l output will be a 'd' for directories so
the regex '^d' selects the lines that start with 'd'.
If you want to learn more than you ever wanted to know about regular
expressions you may want to get the O'Reilly book called 'Mastering
Regular Expressions, 2nd edition'
-- Thanks Charles LaCour
- Next message: ynotssor: "Re: Homework Question: egrep and piping"
- Previous message: Tarvok: "Homework Question: egrep and piping"
- In reply to: Tarvok: "Homework Question: egrep and piping"
- Next in thread: ynotssor: "Re: Homework Question: egrep and piping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|