DEV Community

mich0w0h
mich0w0h

Posted on

Shell: Print file types of all files in a directory

What I want to achieve

  • print file types such as ASCII text or directory in the shell
  • print all file types in a directory

Solution

Use the file command.

For example, to display the file types in the sample directory, enter this command;

$ file sample/*
Enter fullscreen mode Exit fullscreen mode

References

Top comments (0)