May 2000
Beginner
761 pages
18h 20m
English
Instead of taking its input from a file, grep often gets its input from a pipe.
% ls -l drwxrwxrwx 2 ellie 2441 Jan 6 12:34 dir1 -rw-r--r-- 1 ellie 1538 Jan 2 15:50 file1 -rw-r--r-- 1 ellie 1539 Jan 3 13:36 file2 drwxrwxrwx 2 ellie 2341 Jan 6 12:34 grades % ls -l | grep '^d' drwxrwxrwx 2 ellie 2441 Jan 6 12:34 dir1d rwxrwxrwx 2 ellie 2341 Jan 6 12:34 grades |
Explanation
The output of the ls command is piped to grep. All lines of output that begin with a d are printed; that is, all directories are printed.
Read now
Unlock full access