Skip to main content

File and Folder

Show file contents from tail with specific line number limit:

tail -n 200 <file>

Show file contents from head with specific line number limit:

head -n 200 <file>

Show only modified time of a file:

stat -c %y filename

Human-readable format:

stat -c %y filename | cut -d'.' -f1

File and directory size with sorting:

sudo du -ah <folder-name>/ | sort -h