Sponsored Content
Top Forums UNIX for Advanced & Expert Users Moving multiple files based on the pattern Post 302641937 by Corona688 on Wednesday 16th of May 2012 05:50:41 PM
Old 05-16-2012
Code:
find -type f -name '*pattern*' -exec mv '{}' /path/to/destination ';'

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving files according to a fixed pattern

I have a static csv file containing two columns (reporttype as 1st column and reportname as 2nd) as follows: Transaction,TRN_alltransactions Transaction,TRN_alltransactions1 Master,MST_allmasters Master,MST_allmasters1 . . . and so on I am running a script to ftp all the report files... (1 Reply)
Discussion started by: geet_cool
1 Replies

2. Shell Programming and Scripting

Split a file into multiple files based on the input pattern

I have a file with lines something like. ...... 123_start ...... ....... 123_end .... ..... 456_start ...... ..... 456_end .... ..... 789_start .... .... 789_end (6 Replies)
Discussion started by: abinash
6 Replies

3. Shell Programming and Scripting

Splitting large file into multiple files in unix based on pattern

I need to write a shell script for below scenario My input file has data in format: qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26 qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28 qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43 qwerty0101CFG 12345... (19 Replies)
Discussion started by: jimmy12
19 Replies

4. Shell Programming and Scripting

split XML file into multiple files based on pattern

Hello, I am using awk to split a file into multiple files using command: nawk '{ if ( $1 == "<process" ) { n=split($2, arr, "\""); file=arr } print > file }' processes.xml <process name="Process1.process"> ... (3 Replies)
Discussion started by: chiru_h
3 Replies

5. UNIX for Dummies Questions & Answers

moving files based on condition

hi i have to move files and send an email and attached the bad files to inform the developer about that. #!/bin/ksh BASE_DIR=/data/SrcFiles cd $BASE_DIR ## finding the files from work directory which are changed in 1 day find -type f -name "*.csv" –ctime 0 > /home/mydir/flist.txt ##... (14 Replies)
Discussion started by: awais290
14 Replies

6. UNIX for Dummies Questions & Answers

Script moving files based on date

Hi, I need a script that moves files based on date to a folder. The folder should be created based on file date. Example is : Date file name ----- -------- Oct 08 07:39 10112012_073952.xls Oct 09 07:39 10112012_073952.xls Oct 10 07:39 ... (6 Replies)
Discussion started by: rockingvj
6 Replies

7. Shell Programming and Scripting

Moving files based on file name

Hi All, I have multiple files in the folder, I want to move those files into the other folder on based of name File names: Template_server1_01==> Template_server1_02==>To one directory /Server1 Template_server1_03==> Template_server2_01==> Template_server2_02==>To one... (9 Replies)
Discussion started by: sharsour
9 Replies

8. Shell Programming and Scripting

Moving old files based on pattern

Hi all I am trying to loop through a directory of files using a given search pattern. some of the files will be duplicated due to the pattern, but of the duplicate files i wanted to move the older files to another location. Is there any straightforward way of doing this ? One of ways I... (1 Reply)
Discussion started by: sthapa
1 Replies

9. UNIX for Advanced & Expert Users

Concatenation of multiple files based on file pattern

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to append multiple text files into one file based on pattern present in filaname

Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames? AAAL_555A_ORANGE1_F190404.TXT AAAL_555A_ORANGE2_F190404.TXT AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Discussion started by: Shankar455
6 Replies
GFS_GLOB(3)															       GFS_GLOB(3)

NAME
gfs_glob - find path names matching a pattern SYNOPSIS
#include <gfarm/gfarm.h> char *gfs_glob (const char * pattern, gfarm_stringlist * paths, gfs_glob_t * types); DESCRIPTION
gfs_glob() searches for all the path names matching pattern that may include a wildcard, and returns paths. The returned path names are accessed by gfarm_stringlist_length(3) and gfarm_stringlist_elem(3). It is necessary to allocate memory space dynamically pointed to by types using gfs_glob_init(3) before calling gfs_glob(3). The allocated memory space needs to be free'ed by gfs_glob_free(3). RETURN VALUES
NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_PATHNAME_TOO_LONG Too long pattern or path name to process. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO
gfs_glob_init(3) gfs_glob_free(3) gfarm_stringlist_init(3) gfarm_stringlist_length(3) gfarm_stringlist_elem(3) gfarm_stringlist_free(3) gfarm_stringlist_free_deeply(3) Gfarm 30 September 2003 GFS_GLOB(3)
All times are GMT -4. The time now is 07:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy