The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find the common numbers in two files vamshi UNIX and Linux RSS News 2 08-19-2008 01:15 AM
Merging two files with a common column manneni prakash Shell Programming and Scripting 2 06-20-2008 02:19 AM
To find all common lines from 'n' no. of files The Observer Shell Programming and Scripting 11 06-16-2008 02:22 PM
COMMON_ROOT=/files/common: is not an identifier nitinmoriwal UNIX for Advanced & Expert Users 2 08-25-2006 08:38 AM
Get un common numbers from two files jingi1234 UNIX for Dummies Questions & Answers 3 10-19-2005 08:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2008
mazhar99's Avatar
mazhar99 mazhar99 is offline
Registered User
  
 

Join Date: Aug 2008
Location: Pakistan / Lahore
Posts: 14
Unhappy list common name files

hican anyone tell how to list all files starting with "abc" only specific month like august .thanks,Mazhar
  #2 (permalink)  
Old 08-18-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
File names, or files containing abc on the first line?

Code:
# File names matching abc* older than one month and newer than two months
find . -name 'abc*' -mtime +30 -mtime -60
# Files containing abc in the first three bytes
find . -mtime +30 -mtime -60 -exec sh -c 'sed -n "/^abc/p;q" {} | grep -q . && echo {}' \;
The relative times are a bit weird, I don't think there's an option to use absolute times in find itself but you could run stat on each file along the lines of the second example and examine the month number (and year?).
  #3 (permalink)  
Old 08-18-2008
mazhar99's Avatar
mazhar99 mazhar99 is offline
Registered User
  
 

Join Date: Aug 2008
Location: Pakistan / Lahore
Posts: 14
Hello

one more thing that i want to move these selected files starting with abc to different directory

thanks in advance

Mazhar
  #4 (permalink)  
Old 08-18-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Code:
whatever commands to produce a list of file names | xargs -i mv {} /path/to/elsewhere
  #5 (permalink)  
Old 08-18-2008
mazhar99's Avatar
mazhar99 mazhar99 is offline
Registered User
  
 

Join Date: Aug 2008
Location: Pakistan / Lahore
Posts: 14
Great Man!

its done.

Mazhar
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0