Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

selecting certain files

$
0
0
Hi,
I have been working on a punch of codes and I got to a problem I hope to get help on. I have some files that I want to work with but the folder has other files in it. For example: The folder contains these files:

Code:

path to files
: /home/distribution/

Code:

ls
:

b.10; b.11; b.12; b.20; b.222; b.1111; b.212

Each of these files have elements within it i.e, they are not empty.
I want to select the files (also with their content) that start with the following lines in another file, then send to another folder:

Code:

path to file
: /home/distribution/filename/

Code:

cat filename
:
10
11
20

Desired output:

path to new folder: /home/distribution/distribution1/

Code:

ls
:
b.10 b.11 b.20

Is there a better way to do this other than by hand if you have a lot of file?
Thanks

Viewing all articles
Browse latest Browse all 16232

Trending Articles