File Properties

stat

Display attributes of files and directories

wc

Count bytes, words, lines in a file

du

Measure disk usage of files and directories

file

Identify (guess) the type of a file

touch

Change timestamps of files and directories

chown

Change owner of files and directories

chgrp

Change group ownership of files and directories

chmod

Change protection mode of files and directories

chattr

Change extended attributes of files and directories

lsattr

List extended attributes of files and directories

When examining a Linux file, the contents are only half the story. Every file and directory also has attributes that describe its owner, size, access permissions, and other information. The ls -l command (see Basic File Operations) displays some of these attributes, but other commands provide additional information.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.