nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Find Unix Linux File / Directory by date And Then Copy / Move File

This is a discussion on Find Unix Linux File / Directory by date And Then Copy / Move File within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; Hi Can anyone tell me , how can i copy or move files or directory by date in a single ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 08-10-2008, 03:27 AM
Member
User
 
Join Date: Jul 2006
Posts: 50
Rep Power: 0
asim.mcp
Default Find Unix Linux File / Directory by date And Then Copy / Move File

Hi

Can anyone tell me , how can i copy or move files or directory by date in a single command?

Regards
Asim
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-10-2008, 04:30 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I'm not aware of a single command but you can always pipe out few things to get final output. For example, print all files created on 2008-07-24:
Code:
ls -l | grep 2008-07-24 | awk '{ print $8}'
To remove, you may need to add another pipe:
Code:
ls -l | grep 2008-07-24 | awk '{ print $8}'|xargs rm
Find command can also help, see man page for details:
Code:
man find
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks

Tags
find , linux , pipes , unix , xargs


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
shell script to search specific file from txt file inside zip file and extract it aasif.shaikh Shell scripting 2 05-31-2008 07:44 PM
Getting the list of directory names into a file hiddenrider007 Shell scripting 2 04-09-2008 10:59 AM
How to copy . files from current directory ricc Linux software 1 06-10-2006 10:23 PM
How can I rename a file by its date? warren Linux software 5 03-30-2006 01:11 PM
error shell script no such file or directory /bin/sh Linux software 1 01-08-2006 09:34 PM


All times are GMT +5.5. The time now is 02:45 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36