Linux
Linux notes
Published: Mar 19, 2025

Normalize file/directory permissions

Directories need execute (x) permissions to change (cd) into.

find -type f -exec chmod a+r {} \;
find -type d -exec chmod a+xr {} \;

MIME types

Check MIME type of a file

file -b --mime <file>

Alternatively, with the xdg-utils package.

xdg-mime query filetype <file>

Be aware that it will first try to recognize the MIME type by file extension. If it fails, it will look at the content of the file.


← Go to parent