--- a/tools/shell/shell.c
+++ b/tools/shell/shell.c
@@ -15301,7 +15301,7 @@
 #ifdef _WIN32
       zTemp = "\\tmp";
 #else
-      zTemp = "/tmp";
+      zTemp = "@TERMUX_PREFIX@/tmp";
 #endif
     }
     p->zTempFile = sqlite3_mprintf("%s/temp%llx.%s", zTemp, r, zSuffix);
