LESSON 9

Data Management

Master data management commands for file operations, text processing, checksums, and efficient data manipulation.

File Viewing

6 commands

Displays the contents of a file.

$ termux-cat [file]

Displays the first part of a file.

$ termux-head [options] [file]

Displays the last part of a file.

$ termux-tail [options] [file]

Displays the contents of a file, one screen at a time.

$ termux-less [file]

Displays the contents of a file in various formats.

$ termux-od [options] [file]

Concatenates and prints files in reverse.

$ termux-tac [file]

File & Directory

8 commands

Lists directory contents.

$ termux-ls [options]

Prints the current working directory.

$ termux-pwd

Creates directories.

$ termux-mkdir [directory]

Copies files and directories.

$ termux-cp [source] [destination]

Moves or renames files and directories.

$ termux-mv [source] [destination]

Removes files or directories.

$ termux-rm [options] [file]

Creates links to files.

$ termux-ln [options] [source] [destination]

Updates the access and modification times of files.

$ termux-touch [options] [file]

File Info

7 commands

Displays file or file system status.

$ termux-stat [file]

Displays information about a file.

$ termux-file-info [file]

Displays the absolute path of a file.

$ termux-realpath [file]

Displays the value of a symbolic link.

$ termux-readlink [options] [file]

Locates the executable file associated with a given command.

$ termux-which [command]

Calculates and verifies MD5 checksums.

$ termux-md5sum [file]

Calculates checksums and counts the number of blocks for a file.

$ termux-sum [file]

Text Processing

6 commands

Cuts out selected portions of each line of a file.

$ termux-cut [options]

Combines lines from multiple files.

$ termux-paste

Sorts lines of text files.

$ termux-sort [options]

Reports or omits repeated lines.

$ termux-uniq [options]

Prints newline, word, and byte counts for each file.

$ termux-wc [options] [file]

Displays a line of text.

$ termux-echo [text]

File Operations

4 commands

Splits a file into pieces.

$ termux-split [options] [file]

Shrink or extend the size of a file.

$ termux-truncate [options] [file]

Synchronizes cached writes to persistent storage.

$ termux-sync

Builds and executes command lines from standard input.

$ termux-xargs [options]

System Info

2 commands

Displays the username of the current user.

$ termux-whoami

Opens a file in the default text editor.

$ termux-file-editor [file]

💡 Data Management Tips

  • • Use cat, head, and tail to quickly view file contents without opening in an editor
  • • Combine cut, paste, and sort for powerful text processing pipelines
  • • Always use cp with -r flag when copying directories recursively
  • • Use md5sum to verify file integrity and detect corruption
  • • Leverage xargs to build complex command lines from input data
  • • Use wc to quickly analyze file statistics and line counts
  • • Pipe commands together (|) for efficient multi-step data processing
  • • Always sync data before critical operations to ensure persistence
  • • Test data manipulation commands with copies before modifying originals