To search for files of paticular file mask.

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat To search for files of paticular file mask.
# 1  
Old 05-08-2013
To search for files of paticular file mask.

how to find files of particular mask from a folder using shell script.
for example if i have to find whether files having file mask like FILE%N%.csv
ie files like FILE123.csv or files like FILE56.csv
are present in the following folder or not.
l
# 2  
Old 05-08-2013
Take a look at the following:
Code:
$ ls
sample.txt  sample1.txt  sample10.txt  sample2.txt  sample3.txt  sample30.txt  sample31.txt  sample32.txt  sample4.txt

$ ls sample[0-9]*.txt
sample1.txt  sample10.txt  sample2.txt  sample3.txt  sample30.txt  sample31.txt  sample32.txt  sample4.txt

# 3  
Old 05-08-2013
Read up about glob and file globbing.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

How to compare file mask?

hey, i have an array which stores different type of file name like File_123.csv, File_as34.csv File_dff.csv that is after undersore it can be a numeric value or alphanumeric or alphabets and it can be different values. now what i have to do is to compare the values after underscore and... (1 Reply)
Discussion started by: ramsavi
1 Replies

2. UNIX for Dummies Questions & Answers

What is mask and effective right mask in setfacl?

Hi Guys, can someone explain what is mask and effective right mask in setfacl and getfacl command with example, unable to get it. (3 Replies)
Discussion started by: Jcpratap
3 Replies

3. Shell Programming and Scripting

search for content in files. Name of files is in another file. Format as report.

Hi I have multiple files in a folder and one file which contains a list of files (one on each line). I was to search for a string only within these files and not the whole folder. I need the output to be in the form File1<tab>string instance 2<tab> string instance 2<tab>string instance 3... (6 Replies)
Discussion started by: pkabali
6 Replies

4. Shell Programming and Scripting

"Search for files in a file and write these files to another file which sould be in some other direc

Hi , Need to shell script to extracts files names and write those to another file in different directory. input file is inputfile.txt abc|1|bcd.dat 123 david123 123 rudy2345 124 tinku5634 abc|1|def.dat 123 jevid123 123 qwer2345 124 ghjlk5634 abc|1|pqr.txt 123 vbjnnjh435 123 jggdy876... (1 Reply)
Discussion started by: dssyadav
1 Replies

5. Red Hat

Samba create mask and dir mask on RHEL 4.8

Hi Experts, I'm using samba -3.6.1 on Red Hat Enterprise Linux ES release 4 (Nahant Update 8) ,all seems ok. The issue im facing is as follows. When ever a user creates a file via windows explorer the permissions assgined to the file are as follows -rw-rwxr--+ 1 tom group2 0 Mar 9... (1 Reply)
Discussion started by: maverick_here
1 Replies

6. UNIX for Dummies Questions & Answers

search a pattern across all file and replace it to all files.

Hi All, HP-UX oradev3 B.11.11 U 9000/800 I have few files, which contain texts. Now I need to search a pattern across all files and replace to that pattern with new one. For example, I have following files they have, which contain something like abc@abc.com, now I need to search text acorss... (6 Replies)
Discussion started by: alok.behria
6 Replies

7. SuSE

Search all files based on first and in all listed files search the second patterns

Hello Linux Masters, I am not a linux expert therefore i need help from linux gurus. Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies

8. Shell Programming and Scripting

how to write a script for existing of IP_add in the files under paticular paths.

Hello , I want to write a script to test the IP_add is hardcoded in the paticular files. the files are available in path . for example. /abs/abn/jkg/frames.sh. like this some files are there in the same path.I manually replaced the IP_ADD with domain name in required files.now i have to... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

9. Shell Programming and Scripting

how to extract a paticular string from the text file with awk.

hello forum members I have txt file which consists the following information. Server: abababa.xyz.ap.mxmx.com Address: 111.143.211.202 Name: rmxd.ipc.ap.mxmx.com Address: 144.111.99.9 from the abovefile i have to extract only string "rmxd.ipc.ap.mxmx.com" through awk command.... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

10. UNIX for Dummies Questions & Answers

Search for a file and get the next two files

Hi, My requirement goes like this. I search for a file using its pattern in a directory. This will be a unique file in that directory. Now i want to get the next two files after the one i find based on time stamp. e.g. i search for the file SRSCLAR.IN12345 in a directory. Now the... (3 Replies)
Discussion started by: sunny_03
3 Replies
Login or Register to Ask a Question