Sponsored Content
Top Forums Shell Programming and Scripting Copying files based on a pattern Post 302662269 by 969murali@gmail on Tuesday 26th of June 2012 11:31:13 AM
Old 06-26-2012
The files are in the one directry only but the file name is lengthy as below and diffrent each other

these files format as below

MIM_110_00000000023_8533.txt.00000000034.txt
MIM_110_00000000024_8533.txt.00000000035.txt
.
.
.
.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copying files from one location to another based on a list

I have a text list of about 3,000 file names (image files), which exist on a server and that I want to copy over to another location. I understand the Unix cp code, but what's the string to have it copy multiple files based on an external list? Many thanks! (4 Replies)
Discussion started by: rebornhonest
4 Replies

2. UNIX for Dummies Questions & Answers

copying a pattern of files in one directory into other with new pattern names...

Hi, I have to copy a set of files abc* in /path/ to /path1/ as abc*_bkp. The list of files appear as follows in /path/: abc1 xyszd abc2 re2345 abcx .. . abcxyz I have to copy them (abc* files only) into /path1/ as: abc1_bkp abc2_bkp abcx_bkp .. . (6 Replies)
Discussion started by: new_learner
6 Replies

3. UNIX for Advanced & Expert Users

Moving multiple files based on the pattern

I want to search for a particular file name patterns and move them to a specific folder, is it possible to do it with awk or sed? (1 Reply)
Discussion started by: rudoraj
1 Replies

4. UNIX for Dummies Questions & Answers

List only files based on a pattern

Hi Gurus, I need to list only the files with out certain extension. For eg from the following list of files: I need to only list: Thanks Shash (7 Replies)
Discussion started by: shash
7 Replies

5. Shell Programming and Scripting

Combine 3 files based on a pattern

HI, I have 3 files that contain the following information (sql output from Oracle database stored in a txt file): File1.txt : alter table "SYS"."INT_COST_PRICE" enable row movement; alter table "SYS"."INT_SOH" enable row movement; alter table "SYSMAN"."XX_ACI_SKURTP" enable row movement;... (6 Replies)
Discussion started by: rparavastu
6 Replies

6. Shell Programming and Scripting

Copying files with a specific pattern

Hi All I am trying to copy files from one location to another and given below are some sample ones: aaa_bbb_ccc_ddd_cost_code_20140330.gz aaa_bbb_ccc_ddd_revenue_zone_20140329.gz aaa_bbb_ccc_ddd_benefit_extract_20140330.csv.gz aaa_bbb_ccc_ddd_profit_zone_20150509.csv.gz... (17 Replies)
Discussion started by: swasid
17 Replies

7. 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

8. Shell Programming and Scripting

Finding all files based on pattern

Hi All, I need to find all files in a directory which are containing specific pattern. Thing is that file name should not consider if pattern is only in commented area. all contents which are under /* */ are commented all lines which are starting with -- or if -- is a part of some sentence... (13 Replies)
Discussion started by: Lakshman_Gupta
13 Replies

9. Shell Programming and Scripting

Copying files to directories based on first 6 character

guys, i did create a script but its too long, though it function the same. # cat nightlyscan.sh #!/usr/ksh deyt=`date +"%Y-%m-%d"` for i in `ls -lrt|grep $deyt|awk '{print $9}'` do cp -f $i /S1/Sophos/logger/ done # but i did not paste it all. this is the desired. (9 Replies)
Discussion started by: kenshinhimura
9 Replies

10. Shell Programming and Scripting

Extract date from files based on file pattern

I want to extract dates from the files and i have different types of files with pattern. I have list file with the patterns and want to date extract based on it in a sh script Files in the directory : file1_20160101.txt file2_20160101_abc.txt filexyz20160101.txt list file with... (2 Replies)
Discussion started by: lijjumathew
2 Replies
DH-EXEC-INSTALL(1)						      dh-exec							DH-EXEC-INSTALL(1)

NAME
dh-exec-install - Install (and possibly rename) files. SYNOPSIS
#! /usr/bin/dh-exec debian/default.conf => /etc/my-package/start.conf usr/bin/* DESCRIPTION
Being a sub-command of dh-exec(1), this program must not be ran directly, but through dh-exec, which automatically runs all available sub-commands if run bare; or explicitly with dh-exec --with=install. It is meant to be used for dh_install(1) files, and those alone. If it finds that its input is not such a file, it will do nothing, but echo back the contents. The purpose of the program is to extend dh_install(1)'s functionality, by allowing to specify a destination filename. This can be accomplished by a special syntax: the " => " mark between a source and a destination means that the source file should be installed with the specified destination name. For obvious reasons, the source must not be a wildcard, and the destination in this case must be a file, and not a directory. All other non-comment lines are left alone. RESTRICTIONS
Due to the way executable scripts are called from debhelper(1), there is no way to know what options were used for the original dh_install(1). This means, that the --sourcedir option of dh_install(1) will not work correctly when dh-exec-install is in use. IMPLEMENTATION
Internally, the renaming happens by creating a temporary directory under debian/tmp/, and copying (or moving, if the source was under debian/tmp/ to begin with) the file there, with the new name. This is done this way to allow dh_install(1) to do the real copying, and allow its options to continue working, even when renaming is involved. The temporary directory is put under debian/tmp so that it will be cleaned by dh_prep(1) when the clean target gets to run. Thus, no extra code is needed anywhere to clean up the renamed files. ENVIRONMENT
DH_EXEC_SCRIPTDIR Indicates which directory the command-specific scripts should be sought for. If not specified, scripts will be searched for in /usr/share/dh-exec/. FILES
$DH_EXEC_SCRIPTDIR/dh-exec-install-* The various scripts for the higher-level program. SEE ALSO
debhelper(1), dh-exec(1), dh_install(1) AUTHOR
dh-exec-install is copyright (C) 2011-2012 by Gergely Nagy <algernon@madhouse-project.org>. 2012-05-03 DH-EXEC-INSTALL(1)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy