Back to course

System Information: uname, df, du

Termux Masterclass: From Zero to Linux Power User on Android

14. System Information: uname, df, du

These commands provide insights into the system architecture and disk usage, essential for managing resources.

1. System Architecture (uname)

uname prints system information. It's often used to determine the hardware architecture Termux is running on.

CommandOutput/Description
unamePrints the kernel name (Linux)
uname -aPrints all system information
uname -mPrints the machine hardware name (e.g., aarch64 for 64-bit ARM devices)

bash $ uname -m aarch64

This architecture (aarch64 or armv7l) dictates which pre-compiled packages Termux downloads.

2. Disk Free Space (df)

df reports the amount of disk space used and available on filesystems.

bash

Show disk space in human-readable format

$ df -h

Look for the entry corresponding to /data or /data/data/com.termux. This shows how much space Termux is occupying within your device's internal storage.

3. Disk Usage (du)

du reports the estimated disk space usage of files and directories.

bash

Summarize disk usage of the current directory (human-readable)

$ du -sh

Show usage for all files and directories in current location

$ du -h

If Termux is running slow or you are low on space, du helps you pinpoint large directories that need cleaning up.