Find or ls with pipe to the command file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find or ls with pipe to the command file
# 8  
Old 05-18-2016
How about
Code:
find . -type f -ls -exec file {} \; | paste -s -d'\t\n' | grep -E "SQLite|XML"

Don't use + as the find line delimiter as that would NOT print line pairs.
# 9  
Old 05-18-2016
You are genius! Wow! Really impressing. Why this is working without an opening parenthesis? I added one and it is working too. I am stumbled Smilie

Code:
*SQLite*|*XML*)

Greetings to all and thank you to all

marek

---------- Post updated at 11:53 AM ---------- Previous update was at 11:43 AM ----------

Thanks too to RudiC

I just saw your answer now. Your command looks completely logic and very elegant; its surly working on your computer, but not on my Mac and with tcsh - ah! and in bash too.

The command
Code:
paste

does not like the delimiters and is answering

Code:
usage: paste [-s] [-d delimiters] file ...

# 10  
Old 05-18-2016
Code:
*SQLite*|*XML*)

in a case statement is the old Bourne shell style.
The newer Posix standard allows
Code:
(*SQLite*|*XML*)

that looks better in text editors with syntax highlighting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk command to split pipe delimited file

Hello, I need to split a pipe de-limited file based on the COLUMN 7 value . If the column value changes I need to split the file Source File Payment|ID|DATE|TIME|CONTROLNUMBER|NUMBER|NAME|INDICATOR 42156974|1137937|10/1/2018|104440|4232|2054391|CARE|1... (9 Replies)
Discussion started by: rosebud123
9 Replies

2. SuSE

Find command doesn't pipe the output as required.

Hi, I am using below code snippet to echo/display the files found (matching a pattern from searchstring.out file) and the corresponding owner. while read j do echo "Pattern to search is:- $j" find / -name "*$j*" |\ while read k do echo "File found is:- $k" owner=$(ls... (9 Replies)
Discussion started by: Vipin Batra
9 Replies

3. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

4. Shell Programming and Scripting

Find for line with not null values at nth place in pipe delimited file

Hi, I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please. thanks in advance. (3 Replies)
Discussion started by: manikms
3 Replies

5. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

6. UNIX for Dummies Questions & Answers

find string and get the rest of the line in a pipe delimited file

Hi friends, I have a file where I should search for a string and get the rest of the line but without the delimiter using awk. for example I have the series of string in a file: input_string.txt bbb ccc aaa and the mapping file looks like this. mapping.txt aaa|12 bbb|23 ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies

7. UNIX for Advanced & Expert Users

Pipe text in to find command

I would like to know why this command does not work. I have a script which connects to and ftp site. After getting the remote files localy i need move each remote file to a archive folder on the FTP site *Please also note that some of the files have spaces in the file name. Im trying to... (3 Replies)
Discussion started by: juanjanse
3 Replies

8. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

9. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

10. UNIX for Dummies Questions & Answers

Pipe out ftp command to a file

hi there all the unix-gurus, anyone can offer me some advise/help? i'm writing a ftp script and i need to spool out the output to a file but i'm facing some problems when i'm doing the following: ftp -n <mail server> ${log_dir}/test_put.log << END user <user_id> <password> verbose bin #... (2 Replies)
Discussion started by: lweegp
2 Replies
Login or Register to Ask a Question