0

I have a folder with number of subdirectories; each subdirectory has multiple files with .smi extension. I am trying to open content of all of them into one file.

I have tried this:

find ./*/*.smi | xargs xdg-open > one_file
find . | xargs xdg-open > one_file
xdg-open */*.smi > one_file
open **/*.smi > one_file

It seems that I am doing something wrong, can somebody help me?

  • content of your .smi files are subtitles, so just text ? – pLumo Jun 5 '18 at 7:19
  • yes yes, just text :) – sergio Jun 5 '18 at 7:21
1

Your commands, e.g. [...] xdg-open > one_file will open the files one by one and send the output of xdg-open to one_file.

But I think you first want to merge the files, and then open the merged file.
You can use cat to concatenate text files:

find . -name "*.smi" -exec cat {} + > one_file.smi
xdg-open one_file.smi
| improve this answer | |
  • 1
    If my answer worked for you, please consider accepting it. – pLumo Jun 5 '18 at 10:33
  • Oh, I thought I did yesterday. Thank you for reminding me and thank you once again! – sergio Jun 7 '18 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.