The UNIX and Linux Forums  

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
SED command ---------help needed veerapureddy Shell Programming and Scripting 4 03-17-2008 05:12 PM
help needed in fuser command anju Shell Programming and Scripting 1 02-20-2008 02:08 AM
help needed in ls command anju Shell Programming and Scripting 1 02-18-2008 07:20 AM
Help needed on Date command nikunj Shell Programming and Scripting 5 07-08-2006 12:37 PM
Help needed for ps command in AIX moe2266 AIX 0 09-30-2005 12:43 PM

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 06-22-2004
manualvin manualvin is offline
Registered User
  
 

Join Date: Jun 2004
Location: KL
Posts: 7
Post help needed for sed command

Hi all,

I need some help with sed command. I'm trying to move all the files with a modified date within 12:00 - 13:00.
What i'm doing here is to do is
ls -lt | grep 'Jun 22 12:' > list.txt

to get all file names within that period.

However how do i strip off
-rw-r--r-- 1 enfoot adi 1816 Jun 22 14:34

and leave just the filename in a list and do a cp -p command to copy all files with the permissions to another new directory?

Any help will be appreciated! OS is solaris 10.2.

Regards,
Alvin
  #2 (permalink)  
Old 06-22-2004
anarchie anarchie is offline
Registered User
  
 

Join Date: May 2004
Location: Hawaii
Posts: 37
I would actually do it like this:

touch -d "Jun 22 11:59" /tmp/first
touch -d "Jun 22 13:00" /tmp/last
find . -maxdepth 1 -newer /tmp/first ! -newer /tmp/last -exec cp -p {} somewhere \;

But that's just me. I also use cygwin, so YMMV.
  #3 (permalink)  
Old 06-25-2004
manualvin manualvin is offline
Registered User
  
 

Join Date: Jun 2004
Location: KL
Posts: 7
Thanks anarchie,

That was helpful!

Regards,
Alvin
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 08:14 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