I have a directory named data
. Inside data
there is one directory samples
which has more than 50 directories and there is one shell script testing.sh
inside data
. The setup looks like below:
data
|___ samples
|______ PREC001
|______ PREC003
|______ PREC023
|______ KRES118
|______ TWED054
.
.
.
|______ PREC098
|___ testing.sh
I want to create a .txt
file with the path for testing.sh
for all the directories in the samples
and also the directory names. I am working on linux.
The created .txt
file should look like below:
/data/testing.sh PREC001 samples
/data/testing.sh PREC003 samples
/data/testing.sh PREC023 samples
/data/testing.sh KRES118 samples
/data/testing.sh TWED054 samples
.
.
.
/data/testing.sh PREC098 samples
How to do that in linux. I actually tried with some basic commands but I couldn't get what I want. Thankyou.