Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-24-2003, 07:28 PM   #1
LQ Newbie
Registered: Aug 2003
Location: upper left corner, US of A
Distribution: several
Posts: 15

Rep: Reputation: 1
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.
Old 11-24-2003, 07:58 PM   #2
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
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?
Old 11-24-2003, 08:07 PM   #3
LQ Newbie
Registered: Nov 2003
Location: Socal
Distribution: Slackware, RedHat
Posts: 13

Rep: Reputation: 0
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++:Operations with iterators frankie_DJ Programming 12 10-20-2005 04:39 AM
Device Driver Program's file operations error thirumalai Programming 5 08-16-2004 03:56 AM
Aritmethical operations davi_cabral Linux - Newbie 1 09-26-2003 12:04 PM
Modem operations dbeyes Linux - Newbie 1 04-22-2003 07:09 PM
Modem operations using ssh lansman Linux - Newbie 3 03-04-2003 07:32 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration