LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-24-2003, 06:28 PM   #1
snorky
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, 06:58 PM   #2
Khabi
Member
 
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, 07:07 PM   #3
miyake
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.
 
  


Reply


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 03:39 AM
Device Driver Program's file operations error thirumalai Programming 5 08-16-2004 02:56 AM
Aritmethical operations davi_cabral Linux - Newbie 1 09-26-2003 11:04 AM
Modem operations dbeyes Linux - Newbie 1 04-22-2003 06:09 PM
Modem operations using ssh lansman Linux - Newbie 3 03-04-2003 06:32 AM


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

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