Sponsored Content
Top Forums Shell Programming and Scripting How to copy specific files when you don't know the file name? Post 302479361 by purdym on Friday 10th of December 2010 11:43:59 AM
Old 12-10-2010
Is it as easy as:

Code:
root@ms:/tmp/r>ls -la
total 96K
drwxr-x---   2 root system 4.0K 10 Dec 2010 10:39 .
drwxrwxrwt  29 bin  bin     84K 10 Dec 2010 10:40 ..
-rw-r-----   1 root system    0 10 Dec 2010 10:38 00_f0_reference_S5_v36.20.1_2.txt
-rw-r-----   1 root system    0 10 Dec 2010 10:38 38.01_E300_41.36_E200_3_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
-rw-r-----   1 root system    0 10 Dec 2010 10:38 38.74_E800_44.24_E1500_1_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
-rw-r-----   1 root system    0 10 Dec 2010 10:39 41.22_E100_43.75_E300_0_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
-rw-r-----   1 root system    0 10 Dec 2010 10:39 44.06_E1400_56.04_E200_2_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
-rw-r-----   1 root system    0 10 Dec 2010 10:39 51.91_E2200_49.86_E900_4_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
root@ms:/tmp/r>ls -1 | head -3 | tail -2
38.01_E300_41.36_E200_3_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
38.74_E800_44.24_E1500_1_ri_OA_f0_S5e_v36-1_ON_0.25lr_36.20.1.in.txt
root@ms:/tmp/r>

You're looking for the two lowest numbered files right?
 

10 More Discussions You Might Find Interesting

1. Solaris

To copy the files newer than specific date

Dear all, Can you help me in copying files newer than speciifc date Thanks in advance, Rajesh (3 Replies)
Discussion started by: RAJESHKANNA
3 Replies

2. Shell Programming and Scripting

Recursively copy only specific files from a directory tree

Hi I am a shell-script newbie and am looking to synchronize certain files in two directory structures. Both these directory-trees are in CVS and so I dont want the CVS directory to be copied over. I want only .sh and .pl files in each subdirectory under these directory trees to be... (3 Replies)
Discussion started by: sharpsharkrocks
3 Replies

3. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

4. Shell Programming and Scripting

How to copy specific file.txt in specific folder?

hye there... i have a problem to copy file in specific folder that will change the name according to host,time(%m%s) and date(%Y%M%D) example folder name: host_20100531.154101801 this folder name will always change... but i just want to copy the AAA.txt and BBB.txt file.. really need... (17 Replies)
Discussion started by: annetote
17 Replies

5. Shell Programming and Scripting

copy specific files and count them - not as easy as it seems!

Hi all: Here's my dilemma: to identify files of a specific type, copy them to a new location while preserving the original file attributes (date, time, full path, etc), and at the same time capture the count of the number of files identified as a variable for later reporting. Here's where I... (9 Replies)
Discussion started by: Yamaha Evans
9 Replies

6. Shell Programming and Scripting

How to copy a directory without specific files?

Hi I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.). Pls advise how can I do that. Thanks (17 Replies)
Discussion started by: reddyr
17 Replies

7. Shell Programming and Scripting

Copy specific file (different but same name) as folder name

I have to copy a particular file present in a main folder having part of the file-name present in many sub-folders to a new destination preserving the name of the source "part of the main folder" and previous file-name of the output file: Example: From /005_0/1000/005.xxx ->... (7 Replies)
Discussion started by: wappor
7 Replies

8. Shell Programming and Scripting

Rsync to copy specific subfolders and files to new directory

RootFolderI: RootFolderI/FolderA/Subfolder1/Subsub1/JPG1.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/Subsub1/JPG2.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/Subsub2/JPG3.jpg . . . RootFolderI/FolderB/Subfolder1/Subsub1/JPG4.jpg -> want this jpg ... (1 Reply)
Discussion started by: blocnt
1 Replies

9. Shell Programming and Scripting

Copy files based on specific word in a file name & its extension and putting it in required location

Hello All, Since i'm relatively new in shell script need your guidance. I'm copying files manually based on a specific word in a file name and its extension and then moving it into some destination folder. so if filename contains hyr word and it has .md and .db extension; it will move to TUM/HYR... (13 Replies)
Discussion started by: prajaktaraut
13 Replies

10. Shell Programming and Scripting

Copy Specific Files Recursively

Is it possible to only copy selected files+its directories when you are copying recursively? find /OriginalFolder/* -type -d \{ -mtime 1 -o -mtime 2 \ } -exec cp -R {} /CopyTo/'hostname'__CopyTo/ \; -print From the above line, I want to only copy *txt and *ini files from /OriginalFolder/* ... (4 Replies)
Discussion started by: apacheLinux
4 Replies
pbmtopsg3(29 June 2001)                                                                                                    pbmtopsg3(29 June 2001)

NAME
pbmtopsg3 - convert PBM images to Postscript with G3 fax compression SYNOPSIS
pbmtopsg3 [--title=title] [--dpi=dpi] [filespec] DESCRIPTION
Converts the PBM images in the input PBM file to pages in a Postscript file encoded with G3 fax compression. If you don't specify filespec, the input is from Standard Input. Remember that you can create a multi-image PBM file simply by concatenating single-image PBM files, so if each page is in a different file, you might do: cat faxpage* | pbmtopsg3 >fax.ps OPTIONS
-title The Postscript title value. Default is no title. -dpi The resolution of the Postscript output. Default is 72 dpi. SEE ALSO
pnmtops(1), pstopnm(1), gs(1), pstopnm(1), pbmtolps(1), pbmtoepsi(1), pbmtog3(1), g3topbm(1), pbm(5) pbmtopsg3(29 June 2001)
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy