Back to course

Understanding the Termux Environment and Home Directory

Termux Masterclass: From Zero to Linux Power User on Android

5. Understanding the Termux Environment and Home Directory

When you launch Termux, you land in your Home Directory. Understanding the file system hierarchy is fundamental to working in Linux.

The Home Directory (~)

In Termux, your personal working area is represented by ~ (tilde).

  • Absolute Path: /data/data/com.termux/files/home
  • Symbolic Path: ~

This is where you will store your scripts, projects, configuration files, and downloaded content.

Key Directories in Termux

Although Termux runs in a sandbox, it mimics a standard Linux file system structure:

DirectoryPurpose
/binEssential executables (commands)
/usr/binAdditional user binaries
/etcSystem-wide configuration files
/tmpTemporary files
/data/data/.../files/homeThe user's home directory (~)
/data/data/.../files/usrWhere packages are installed

The PATH Variable

The PATH variable tells the shell where to look for executable programs. In Termux, when you type ls, the system searches the directories listed in PATH (like /bin and /usr/bin) until it finds the ls program.

Command to view your current directory:

bash $ pwd /data/data/com.termux/files/home

Command to list environment variables (including PATH):

bash $ printenv | less

We will explore navigating these directories in the next lesson.