-   Linux - Newbie (
-   -   file operations in BASH (

snorky 11-24-2003 06:28 PM

file operations in BASH
How can I perform file operations using criteria other than file names?
For instance, using ls but only displaying files with a certain owner or files modified on a certain date? Same for cp, rm, mv, etc.

Khabi 11-24-2003 06:58 PM

well, you could do
ls -al | grep root

that would show all the files and directories that either belong to root or are in the root group. That won't work on cp, rm, or mv tho. I can't think of any way to use those like that. Anyone else?

miyake 11-24-2003 07:07 PM

The following will find and list all files owned by root in the current (./) directory

$ find . -user root -exec ls -la {} \;

`man find` for other options.

All times are GMT -5. The time now is 05:00 PM.