Search for specific file type in subdirectory with multiple folders
I have a directory that is in the below order (the --- is not part of the directory tree, only there to help illustrate:
The bash below reads each line in out.txt and uses that in a below. So for this example a would be /home/cmccabe/nfs/exportedReports/Folder1. What I am having trouble with is the vcf.gz being searched for is two more levels down (last level in the above). /home/cmccabe/nfs/exportedReports/plugin_out/variantCaller_out.40/001. The level right before that /home/cmccabe/nfs/exportedReports/plugin_out/variantCaller_out.40 is consistent unitil the ., then the numbers varies. So in this example variantCaller_out.40 the portion in bold will change. The last level has 3 folders 001, 002, 003 that the vcf.gz can be found in.
I guess what I am trying to do is search for each vcf.gzin
Bash
contents of out.txt
within Folder1
next level Folder1/plugin_out
next level Folder1/plugin_out/variantCaller_out.40
Currently I am getting syntax errors. Thank you .
Last edited by cmccabe; 09-19-2016 at 04:40 PM..
Reason: added details
Hi,
I am newbie in UNIX so please excuse for my questions.
Is there a a way to search for string in files within folder and sub folder in particluar file extensions.
Ex. search for ABC in folder 'A'(including it's sub folders) in html, xml files.
Thanks,
Ani (2 Replies)
Hi,
I need to search for some strings in specific positions in a file.
If the strings: "foo1", "foo2" or "foo3" is on position 266 or position 288 in a file i want the whole line printed.
Any idea how to do it? (5 Replies)
Hi All,
I was exploring find command and came across -prune option which would exclude search in a mention subdirectory.
My quesry is to search all files more that 100 MB size but exclude search in a subdirectory.
I am using below command,but somehow it is not working.
Can anybody help me... (6 Replies)
Ok question number two: I'd like to search a directory for multiple file types (rar, txt, deb) and depending on what's found, copy those files to folders named Rar, TextFiles, and Debs. I'm looking for speed here so the faster the script the better. I want it to be a function that I pass 1 argument... (4 Replies)
Hi I made this code to search in directory for file and size
How can I remodel it to seach in the sub direcotry as well
Thanks
#!/bin/bash
echo -n "Enter: "
read var
if
then
echo "Directory exists: ${var}"
size=`du -hs "${var}"`
echo The size of the current folder is... (4 Replies)
Hi,
I have a script that handles a huge amount of log files from many machines and copies it into a SAN location with the following directory structure:
/SAN/machinenames/yyyy/m/d
so for example
/SAN/hosta/2011/3/12/files*
Now I am writing a bash script to search for files between to date... (4 Replies)
hi I want to write a script which count the number of subdirectories in the current root directory that contain more than a specified number of files of a specific type. Is there an easy way to do this?
Thanks
Robert (2 Replies)
I have a simple function that greps within a folder into files that are already gunzipped. This was already written for me so from my understanding fn=$1 specifies that it will look into any file in that folder that is gunzipped and the rest of the script greps the data its looking for and puts it... (3 Replies)
I am trying to write a script that cycles through a folder containing many folders and when inside each one it's supposed to copy all the .fna.gz files to a folder elsewhere if the file and the respective folder have the same name.
for fldr in /home/playground/genomes/* ; do
find .... (8 Replies)
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)