troubleshooting Question

determine the files extension

Avatar of totoroha
totoroha asked on
Scripting LanguagesSystem ProgrammingShell Scripting
24 Comments1 Solution205 ViewsLast Modified:
In linux, we can use the command file "example.txt" to determine the true extension of the file. Even if I rename the original file to example.txt, the file command still can recognize the true extension by using magic header.
So do we have any way to determine the list of files inside a folder by using bash, powershell or python. I prefer these languages because it's easy for me to read and understand.

Can anyone help me with this?

Thank you so much.
Join our community to see this answer!
Unlock 1 Answer and 24 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 24 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros