Sponsored Content
Top Forums Shell Programming and Scripting shell script to find and copy the files creted in the year 2006 to another directory Post 302180709 by manas6 on Tuesday 1st of April 2008 01:37:20 AM
Old 04-01-2008
shell script to find and copy the files creted in the year 2006 to another directory

Hi All,

I am new to UNIX. I will be thankful if some one helps me.
I have to write a shell script for one of the requirement.

I have files created from Jan 2006 to March 2008.
My requirement is to write a script in such a way that
1) To find and copy(not Moving) the files created in the year 2006 to another directory(xyz). The shell should automatically create the directory in the currect path.
2) Then the compress the folder(xyz), which contains all the files created in the year 2006.


Thanks in advance.

Regards
manas
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find files and copy into a directory

hi all, can u please help me in finding all ksh file in directory and including all subdirectories and then copy those files into another directory. thanks in advance -bali (4 Replies)
Discussion started by: balireddy_77
4 Replies

2. UNIX for Dummies Questions & Answers

Find & Copy Selected files to another Directory

I am wanting to find files within a directory that are over a certain number of days old and copy them to another directory. And unfortunately not having much luck.......is someone able to help. Would also like to add that there are literally thousands of files that I am wanting to copy in one... (3 Replies)
Discussion started by: hellfyre
3 Replies

3. UNIX for Dummies Questions & Answers

How to find and copy files from one directory to another

Ok i have three directories Destination - /u/dir1 (has subdirectories dir2 which also has subdirectory dir3) Source1 - /u/test/files/dir1/dir2/dir3 Source2 - /u/out/images/dir1/dir2/dir3 What i would like to do is copy everything from Source1 and Source2 into the Destination directory.... (3 Replies)
Discussion started by: ziggy25
3 Replies

4. Shell Programming and Scripting

Delete all the files and subdirectories for the year 2006

Hi I have lot of files and subdirectories inside a directory which are created in the years 2006, 2007, 2008, 2009 and 2010. I want to delete all the files and subdirectories belonging to the year 2006 alone. How can I do that ? (5 Replies)
Discussion started by: samsungsamsung
5 Replies

5. Shell Programming and Scripting

Script to Poll Directory and Copy files

Hi all, I'm looking for a script to poll a specified directory and copy new files to another location. The script should only copy new files so, I based on mtime I guess? Can anyone point me in the right direction of a script which could do this? My scripting skills aren't too bad, but... (1 Reply)
Discussion started by: JayC89
1 Replies

6. Shell Programming and Scripting

Need a shell script which takes two inputs and copy the files from one directory to other

Hi, I am using solari 10 OS which is having bash shell. I need a shell script which takes user home directory and name of the file or directory as a input and based on that copy the files accordingly to the other directory. example:I hava a machine1 which is having some files in a... (8 Replies)
Discussion started by: muraliinfy04
8 Replies

7. Linux

Find MSWord doc Files by Year and then Copy

I need to be able to find all *.doc files by year last modified and then perform an action such as copy to folder: /documents/2011 the 'find' command seems to show the path but not the full file details, which includes the date modified as the ls command does. I got this far with ls, but have... (2 Replies)
Discussion started by: jamarsh
2 Replies

8. Shell Programming and Scripting

Find and copy these files to particular directory

RedHat Enterprise Linux 5.4 I have some files with the extension .cdp in several directories in various mountpoints(filesystems) . I would like to find and copy all these files into a single directory /u03/diagnore/data. How can I do this ? (3 Replies)
Discussion started by: kraljic
3 Replies

9. Shell Programming and Scripting

Shell script to find and replace contents of files in directory

Hi all This is my first post. Please bear with me with all my mistakes. I started learning shell since couple of days now and this might be quite basic for all, i want to search for files in a directory containing specific string and replace it with new string. The code i wrote is quite bulky... (2 Replies)
Discussion started by: theprogrammer
2 Replies

10. Shell Programming and Scripting

Shell script to find the GB files in /tmp directory in remote server

Hi, i need help on shell scripting. Main intention of the script is step 1: ssh to remote server Step 2: cd /tmp in remote server Step 3: in tmp i want to grep only files and directories which are in GB sizes All the servers list file is - tmpsrv.txt vi tmpsrv.txt ... (17 Replies)
Discussion started by: kumar85shiv
17 Replies
cow-shell(1)							     cowdancer							      cow-shell(1)

NAME
cow-shell - Start a copy-on-write session and invoke a shell. SYNOPSIS
cow-shell [commandline] DESCRIPTION
cow-shell Executes specified command with cowdancer or a shell if no command-line option is given. Inside the cowdancer session, files under the current directory are protected in a way so that a write operation to an i-node which existed at the point of running cow-shell is not modified. Useful for managing hard-linked source-trees and scratch-filesystems. EXAMPLES
cp -al cowdancer/ cowdancer.new && cd cowdancer.new && cow-shell Create a hardlinked tree, and cd into the newly created tree. After invoking cow-shell inside that tree, a write operation against a file that is hardlinked with the original tree will be copied to a new file before write. cp -al cowdancer/ cowdancer.new && cd cowdancer.new && cow-shell debuild Tries to run dpkg-buildpackage on the new tree, to avoid damage to the original tree. Configure debuild to ignore .ilist files, through -i or -I option. FILES
.ilist Generated dynamically in the current directory. The file contains the list of i-node numbers that should be protected from write operation. /usr/lib/cowdancer/libcowdancer.so The shared library used internally that overrides some functions that potentially write to files. This library implements the COW feature and is preloaded with LD_PRELOAD. /bin/cp Used for copying. Requires GNU option -a to be functional. ENVIRONMENT
COWDANCER_ILISTFILE The path to the current .ilist file. COWDANCER_IGNORE Used internally to work around infinite loops. It will be unset. LD_PRELOAD Utilized to preload libcowdancer.so COWDANCER_DEBUG Debugging option. Enables debug messages. cowdancer will give verbose debug messages in standard error output. COWDANCER_SO Debugging option. Specifies a different path for libcowdancer.so. COWDANCER_REUSE=yes Enables reuse of cowdancer .ilist file found for consecutive runs of cow-shell. RETURN VALUE
The functions that are overridden with cowdancer will give an errno value of ENOMEM when there is a problem. System isn't really out of memory, but this error code is chosen because this error is usually handled gracefully by applications. RESTRICTIONS
Can only support directories that are scanned by cow-shell command. The operation is not semantically correct when files are originally hardlinked, hardlinks are always broken. Does not support anything when LD_PRELOAD trick does not work. Does not work unless hardlinks are supported on the filesystem. Not very user-friendly. Leaves .ilist file around. AUTHOR
Junichi Uekawa (dancer@debian.org) Upstream page is available at http://www.netfort.gr.jp/~dancer/software/cowdancer.html SEE ALSO
cowdancer-ilistcreate (1) cowdancer 2006 Jan 25 cow-shell(1)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy