How To Combine File Names From find Output Into A String Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How To Combine File Names From find Output Into A String without wasting too much if your time.

The question is published on by Tutorial Guruji team.

Using find it is trivial to lookup all files with a particular pattern:

find . -name *.jar

How do I combine the results of that command (e.g. all of the filenames) into a single string separated by a :?

The expected result would look something like:

"./foo.jar:./bar.jar"

Thank you in advance for your consideration and response.

Answer

find . -name *.jar -printf '%P:'

We are here to answer your question about How To Combine File Names From find Output Into A String - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji