Skip to main content
edited body
Source Link
Raphael Ahrens
  • 9.9k
  • 5
  • 39
  • 53

I am trying use the results of "file" which returns info about the file/s I specify.

E.g.

file *.doc 'all .doc extensions 

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How doIido I actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g.

file *.doc 'all .doc extensions 

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How doIi actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g.

file *.doc 'all .doc extensions 

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How do I actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

deleted 133 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228

This is will be my first post in this forums. I have no idea what I am doing. Seriously. I will try my best to explain my goal.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g. file *.doc 'all .doc extensions

file *.doc 'all .doc extensions 

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How do idoIi actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

This is will be my first post in this forums. I have no idea what I am doing. Seriously. I will try my best to explain my goal.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g. file *.doc 'all .doc extensions

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How do i actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g.

file *.doc 'all .doc extensions 

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How doIi actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.

Source Link

How to use the results of "file" (Name of Creating Application: Microsoft Word) to search for a specific string?

This is will be my first post in this forums. I have no idea what I am doing. Seriously. I will try my best to explain my goal.

I am trying use the results of "file" which returns info about the file/s I specify.

E.g. file *.doc 'all .doc extensions

This then returns information about the file including "Name of Creating Application: Microsoft Word" Now, I am trying to search the results for the string "Word". I'm stuck here. How do i actually do that?

*This is what I tried after hours of searching. I just don't know what word I'm looking for. Please advise.

find . -type f -print0 | xargs -0 grep -lh "Microsoft Word" | xargs -I % mv % ../NewDirectory/ 

I think this searches for the string "Word" inside the files itself and moves it to the new directory.