-
Notifications
You must be signed in to change notification settings - Fork 3
Commands: cdt
tanazd1-octo edited this page Mar 26, 2026
·
1 revision
Run commands in any directory without changing your current location.
⚡ Part of termux-miscellaneous
cdt (change directory temporarily) allows you to execute a command in another directory
without manually using cd and then coming back.
It keeps your current working directory unchanged.
cdt <directory> <command>cdt /sdcard lscdt ~/projects/myapp ./run.shcdt ~/code gcc main.c -o main- Temporarily switches to target directory
- Executes the given command
- Returns to original directory automatically
Equivalent to:
(cd <directory> && <command>)Your current directory is preserved.
- Does NOT change your shell’s working directory permanently
- Works with any valid command
- Useful for scripting and automation
- Command must be valid in the target directory
- Relative paths inside command depend on target directory
Run build without leaving current folder:
cdt ~/project makeCheck files anywhere quickly:
cdt /data/data ls