inotifywait #52

Open
opened 2025-11-05 13:07:15 +01:00 by Benjamin_Loison · 20 comments

DuckDuckGo and Google search "inotifywait" "adb".

Could execute Termux binary, but I prefer avoiding to do so.

dstmath/inotifywait-for-Android has 121 stars and last commit was 9 years ago.

DuckDuckGo and Google search `"inotifywait" "adb"`. Could execute Termux binary, but I prefer avoiding to do so. [dstmath/inotifywait-for-Android](https://github.com/dstmath/inotifywait-for-Android) has 121 stars and last commit was 9 years ago.
Author
Owner

Maybe can adb push Termux inotifywait:

On Termux:

which inotifywait
/data/data/com.termux/files/usr/bin/inotifywait
adb root
adb pull /data/data/com.termux/files/usr/bin/inotifywait
/data/data/com.termux/files/usr/bin/in...pped. 2.4 MB/s (24464 bytes in 0.010s)
adb unroot
restarting adbd as non root
adb push inotifywait .
Output:
inotifywait: 1 file pushed, 0 skipped. 231.7 MB/s (24464 bytes in 0.000s)
adb: error: failed to copy 'inotifywait' to './inotifywait': remote couldn't create file: Read-only file system
adb push inotifywait /sdcard/
inotifywait: 1 file pushed, 0 skipped. 121.8 MB/s (24464 bytes in 0.000s)
./inotifywait                                                    
/system/bin/sh: ./inotifywait: can't execute: Permission denied
chmod +x inotifywait
./inotifywait
/system/bin/sh: ./inotifywait: can't execute: Permission denied
ls -lh inotifywait                                               
-rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait
chown shell: inotifywait
ls -lh inotifywait
-rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait
chmod 770 inotifywait
ls -lh inotifywait                                               
-rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait

On my Linux Mint 22.2 Cinnamon Framework 13:

ls -lh inotifywait 
-rw-r--r-- 1 benjamin_loison benjamin_loison 24K Nov  5 13:09 inotifywait
file inotifywait
inotifywait: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped
Maybe can `adb push` Termux `inotifywait`: On Termux: ``` which inotifywait ``` ``` /data/data/com.termux/files/usr/bin/inotifywait ``` ``` adb root adb pull /data/data/com.termux/files/usr/bin/inotifywait ``` ``` /data/data/com.termux/files/usr/bin/in...pped. 2.4 MB/s (24464 bytes in 0.010s) ``` ``` adb unroot ``` ``` restarting adbd as non root ``` ``` adb push inotifywait . ``` <details> <summary>Output:</summary> ``` inotifywait: 1 file pushed, 0 skipped. 231.7 MB/s (24464 bytes in 0.000s) adb: error: failed to copy 'inotifywait' to './inotifywait': remote couldn't create file: Read-only file system ``` </details> ``` adb push inotifywait /sdcard/ ``` ``` inotifywait: 1 file pushed, 0 skipped. 121.8 MB/s (24464 bytes in 0.000s) ``` ``` ./inotifywait ``` ``` /system/bin/sh: ./inotifywait: can't execute: Permission denied ``` ``` chmod +x inotifywait ./inotifywait ``` ``` /system/bin/sh: ./inotifywait: can't execute: Permission denied ``` ``` ls -lh inotifywait ``` ``` -rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait ``` ``` chown shell: inotifywait ls -lh inotifywait ``` ``` -rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait ``` ``` chmod 770 inotifywait ls -lh inotifywait ``` ``` -rw-rw---- 1 root everybody 24K 2025-11-05 13:09 inotifywait ``` On my Linux Mint 22.2 Cinnamon Framework 13: ``` ls -lh inotifywait ``` ``` -rw-r--r-- 1 benjamin_loison benjamin_loison 24K Nov 5 13:09 inotifywait ``` ``` file inotifywait ``` ``` inotifywait: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped ```
Author
Owner

DuckDuckGo and Google search adb push chown.

chown shell.shell inotifywait

does not return anything and does not help, source: the Stack Overflow answer 14084617.

DuckDuckGo and Google search *adb push chown*. ```bash chown shell.shell inotifywait ``` does not return anything and does not help, source: [the Stack Overflow answer 14084617](https://stackoverflow.com/a/14084617).
Author
Owner

DuckDuckGo and Google search adb push as shell and adb chown shell.

The Stack Overflow answer 37781988:

id
uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0
chown 2000.2000 inotifywait

does not return anything and does not help.

DuckDuckGo and Google search adb push executable.

cp
cp: Needs 1 argument (see "cp --help")

The Android Stack Exchange answer 45564:

adb shell ls -lh /data/local/
ls: /data/local/: Permission denied

I am fine using a temporary folder.

adb shell ls -lh /data/local/tmp/
Output:
total 6
drwxrwxrwx 3 shell shell 3.3K 2025-08-27 17:22 dalvik-cache
drwxrwxrwx 3 shell shell 3.3K 2025-11-03 01:08 web-ext-artifacts-1762128530517
adb push inotifywait /data/local/tmp/
inotifywait: 1 file pushed, 0 skipped. 220.2 MB/s (24464 bytes in 0.000s)
DuckDuckGo and Google search *adb push as shell* and *adb chown shell*. [The Stack Overflow answer 37781988](https://stackoverflow.com/a/37781988): ``` id ``` ``` uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 ``` ```bash chown 2000.2000 inotifywait ``` does not return anything and does not help. DuckDuckGo and Google search *adb push executable*. ``` cp ``` ``` cp: Needs 1 argument (see "cp --help") ``` [The Android Stack Exchange answer 45564](https://android.stackexchange.com/a/45564): ``` adb shell ls -lh /data/local/ ``` ``` ls: /data/local/: Permission denied ``` I am fine using a temporary folder. ``` adb shell ls -lh /data/local/tmp/ ``` <details> <summary>Output:</summary> ``` total 6 drwxrwxrwx 3 shell shell 3.3K 2025-08-27 17:22 dalvik-cache drwxrwxrwx 3 shell shell 3.3K 2025-11-03 01:08 web-ext-artifacts-1762128530517 ``` </details> ``` adb push inotifywait /data/local/tmp/ ``` ``` inotifywait: 1 file pushed, 0 skipped. 220.2 MB/s (24464 bytes in 0.000s) ```
Author
Owner
adb shell ls -lh /data/local/tmp/
Output:
total 30
drwxrwxrwx 3 shell shell 3.3K 2025-08-27 17:22 dalvik-cache
-rw-rw-rw- 1 shell shell  24K 2025-11-05 13:09 inotifywait
drwxrwxrwx 3 shell shell 3.3K 2025-11-03 01:08 web-ext-artifacts-1762128530517
``` adb shell ls -lh /data/local/tmp/ ``` <details> <summary>Output:</summary> ``` total 30 drwxrwxrwx 3 shell shell 3.3K 2025-08-27 17:22 dalvik-cache -rw-rw-rw- 1 shell shell 24K 2025-11-05 13:09 inotifywait drwxrwxrwx 3 shell shell 3.3K 2025-11-03 01:08 web-ext-artifacts-1762128530517 ``` </details>
Author
Owner
/data/local/tmp/inotifywait
/system/bin/sh: /data/local/tmp/inotifywait: can't execute: Permission denied
chmod +x /data/local/tmp/inotifywait
ls -lh /data/local/tmp/inotifywait
-rwxrwxrwx 1 shell shell 24K 2025-11-05 13:09 /data/local/tmp/inotifywait
/data/local/tmp/inotifywait
CANNOT LINK EXECUTABLE "/data/local/tmp/inotifywait": library "libinotifytools.so" not found: needed by main executable
``` /data/local/tmp/inotifywait ``` ``` /system/bin/sh: /data/local/tmp/inotifywait: can't execute: Permission denied ``` ``` chmod +x /data/local/tmp/inotifywait ls -lh /data/local/tmp/inotifywait ``` ``` -rwxrwxrwx 1 shell shell 24K 2025-11-05 13:09 /data/local/tmp/inotifywait ``` ``` /data/local/tmp/inotifywait ``` ``` CANNOT LINK EXECUTABLE "/data/local/tmp/inotifywait": library "libinotifytools.so" not found: needed by main executable ```
Author
Owner

On Termux:

inotifywait
No files specified to watch!
ld inotifywait
ld: cannot find inotifywait: No such file or directory
lld inotifywait
Output:
lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
ld `which inotifywait`
ld: warning: cannot find entry symbol _start; not setting start address
lld `which inotifywait`
Output:
lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
apt install -y ldd
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  ldd
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 1844 B of archives.
After this operation, 45.1 kB of additional disk space will be used.
Get:1 https://grimler.se/termux/termux-main stable/main aarch64 ldd aarch64 0.3 [1844 B]
Fetched 1844 B in 0s (4663 B/s)
Selecting previously unselected package ldd.
(Reading database ... 104813 files and directories currently installed.)
Preparing to unpack .../archives/ldd_0.3_aarch64.deb ...
Unpacking ldd (0.3) ...
Setting up ldd (0.3) ...
ldd inotifywait
Output:
readelf: Error: '/data/data/com.termux/files/home/inotifywait': No such file
readelf: Error: '/data/data/com.termux/files/home/inotifywait': No such file
ldd `which inotifywait`
Output:
	libinotifytools.so => /data/data/com.termux/files/usr/lib/libinotifytools.so
	libc.so => /system/lib64/libc.so
	libc++_shared.so => /data/data/com.termux/files/usr/lib/libc++_shared.so
	libm.so => /system/lib64/libm.so
	libdl.so => /system/lib64/libdl.so
	ld-android.so => /system/lib64/ld-android.so
scp fp4:/data/data/com.termux/files/usr/lib/libinotifytools.so .
libinotifytools.so                                                                                       100%   33KB 430.6KB/s   00:00
adb push libinotifytools.so /data/local/tmp/
libinotifytools.so: 1 file pushed, 0 skipped. 64.5 MB/s (33456 bytes in 0.000s)
/data/local/tmp/inotifywait                                                                                                       
CANNOT LINK EXECUTABLE "/data/local/tmp/inotifywait": library "libinotifytools.so" not found: needed by main executable
ls -lh /data/local/tmp/ | grep inotify                                                                                            
Output:
-rwxrwxrwx 1 shell shell  24K 2025-11-05 13:09 inotifywait
-rwxrwxrwx 1 shell shell  33K 2025-11-05 13:24 libinotifytools.so
cd /data/local/tmp/
./inotifywait                                                                                                       
CANNOT LINK EXECUTABLE "./inotifywait": library "libinotifytools.so" not found: needed by main executable

DuckDuckGo and Google search Linux specify .so to executable.

The Server Fault answer 279069:

echo $LD_LIBRARY_PATH

does not return anything.

The Server Fault answer 699902:

LD_LIBRARY_PATH=. ./inotifywait                                                                                     
CANNOT LINK EXECUTABLE "./inotifywait": library "libc++_shared.so" not found: needed by /data/local/tmp/libinotifytools.so in namespace (default)

If proceed similarly with libc++_shared.so.

LD_LIBRARY_PATH=. ./inotifywait
No files specified to watch!

I uninstalled Termux on Samsung Galaxy A53 to avoid bias.

adb push inotifywait lib{inotifytools,c++_shared}.so /data/local/tmp/
Output:
inotifywait: 1 file pushed, 0 skipped. 42.9 MB/s (24464 bytes in 0.001s)
libinotifytools.so: 1 file pushed, 0 skipped. 252.0 MB/s (33456 bytes in 0.000s)
libc++_shared.so: 1 file pushed, 0 skipped. 282.5 MB/s (1253544 bytes in 0.004s)
3 files pushed, 0 skipped. 21.9 MB/s (1311464 bytes in 0.057s)
cd /data/local/tmp/
chmod +x inotifywait
LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/                                                      
Output:
Setting up watches.
Watches established.
/sdcard/DCIM/Camera/ CLOSE_WRITE,CLOSE 20251105_133309.jpg

Attachments are based on my Fairphone 4 own LineageOS 22.2 Termux.

Being able to retrieve them by download would be nice.

On Termux: ``` inotifywait ``` ``` No files specified to watch! ``` ``` ld inotifywait ``` ``` ld: cannot find inotifywait: No such file or directory ``` ``` lld inotifywait ``` <details> <summary>Output:</summary> ``` lld is a generic driver. Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead ``` </details> ``` ld `which inotifywait` ``` ``` ld: warning: cannot find entry symbol _start; not setting start address ``` ``` lld `which inotifywait` ``` <details> <summary>Output:</summary> ``` lld is a generic driver. Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead ``` </details> ``` apt install -y ldd ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: ldd 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 1844 B of archives. After this operation, 45.1 kB of additional disk space will be used. Get:1 https://grimler.se/termux/termux-main stable/main aarch64 ldd aarch64 0.3 [1844 B] Fetched 1844 B in 0s (4663 B/s) Selecting previously unselected package ldd. (Reading database ... 104813 files and directories currently installed.) Preparing to unpack .../archives/ldd_0.3_aarch64.deb ... Unpacking ldd (0.3) ... Setting up ldd (0.3) ... ``` </details> ``` ldd inotifywait ``` <details> <summary>Output:</summary> ``` readelf: Error: '/data/data/com.termux/files/home/inotifywait': No such file readelf: Error: '/data/data/com.termux/files/home/inotifywait': No such file ``` </details> ``` ldd `which inotifywait` ``` <details> <summary>Output:</summary> ``` libinotifytools.so => /data/data/com.termux/files/usr/lib/libinotifytools.so libc.so => /system/lib64/libc.so libc++_shared.so => /data/data/com.termux/files/usr/lib/libc++_shared.so libm.so => /system/lib64/libm.so libdl.so => /system/lib64/libdl.so ld-android.so => /system/lib64/ld-android.so ``` </details> ``` scp fp4:/data/data/com.termux/files/usr/lib/libinotifytools.so . ``` ``` libinotifytools.so 100% 33KB 430.6KB/s 00:00 ``` ``` adb push libinotifytools.so /data/local/tmp/ ``` ``` libinotifytools.so: 1 file pushed, 0 skipped. 64.5 MB/s (33456 bytes in 0.000s) ``` ``` /data/local/tmp/inotifywait ``` ``` CANNOT LINK EXECUTABLE "/data/local/tmp/inotifywait": library "libinotifytools.so" not found: needed by main executable ``` ``` ls -lh /data/local/tmp/ | grep inotify ``` <details> <summary>Output:</summary> ``` -rwxrwxrwx 1 shell shell 24K 2025-11-05 13:09 inotifywait -rwxrwxrwx 1 shell shell 33K 2025-11-05 13:24 libinotifytools.so ``` </details> ``` cd /data/local/tmp/ ./inotifywait ``` ``` CANNOT LINK EXECUTABLE "./inotifywait": library "libinotifytools.so" not found: needed by main executable ``` DuckDuckGo and Google search *Linux specify .so to executable*. [The Server Fault answer 279069](https://serverfault.com/a/279069): ```bash echo $LD_LIBRARY_PATH ``` does not return anything. [The Server Fault answer 699902](https://serverfault.com/a/699902): ``` LD_LIBRARY_PATH=. ./inotifywait ``` ``` CANNOT LINK EXECUTABLE "./inotifywait": library "libc++_shared.so" not found: needed by /data/local/tmp/libinotifytools.so in namespace (default) ``` If proceed similarly with `libc++_shared.so`. ``` LD_LIBRARY_PATH=. ./inotifywait ``` ``` No files specified to watch! ``` I uninstalled Termux on Samsung Galaxy A53 to avoid bias. ``` adb push inotifywait lib{inotifytools,c++_shared}.so /data/local/tmp/ ``` <details> <summary>Output:</summary> ``` inotifywait: 1 file pushed, 0 skipped. 42.9 MB/s (24464 bytes in 0.001s) libinotifytools.so: 1 file pushed, 0 skipped. 252.0 MB/s (33456 bytes in 0.000s) libc++_shared.so: 1 file pushed, 0 skipped. 282.5 MB/s (1253544 bytes in 0.004s) 3 files pushed, 0 skipped. 21.9 MB/s (1311464 bytes in 0.057s) ``` </details> ```bash cd /data/local/tmp/ chmod +x inotifywait ``` ``` LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/ ``` <details> <summary>Output:</summary> ``` Setting up watches. Watches established. /sdcard/DCIM/Camera/ CLOSE_WRITE,CLOSE 20251105_133309.jpg ``` </details> Attachments are based on my Fairphone 4 own LineageOS 22.2 Termux. Being able to retrieve them by download would be nice.
Author
Owner
adb shell 'cd /data/local/tmp/ && LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/'
Output:
Setting up watches.
Watches established.
/sdcard/DCIM/Camera/ CLOSE_NOWRITE,CLOSE 20251105_133439.jpg
```bash adb shell 'cd /data/local/tmp/ && LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/' ``` <details> <summary>Output:</summary> ``` Setting up watches. Watches established. /sdcard/DCIM/Camera/ CLOSE_NOWRITE,CLOSE 20251105_133439.jpg ``` </details>
Author
Owner
adb shell cd /data/local/tmp/ && LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/
bash: ./inotifywait: Permission denied
``` adb shell cd /data/local/tmp/ && LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/ ``` ``` bash: ./inotifywait: Permission denied ```
Author
Owner
It helps the issue:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdATyv+PYuniG85WK3rODq4EhEn1npH1hS5seUxn2wIVWAw
XjcrdTQThC6Vw4EGcYH+L8PaNAONZtn95YMSXRzUMvdUeqdCBUbbIpFHutxwLy7M
1LUBCQIQCoHoIFymQ/lN0nYMWBbRHhuqlMqCSvg/4PU7+rv7p5qvGtZyf5YznYPP
E+PITKMwP/dE9qS7tcn41TS0jeNr14MD+vYuG3faDkOY6uGeN1OiAiKA1Tdiaxtf
BoOn2ywQQ4A/XrpTvn3IiMFmIjejKFC4uxfeGUiAKgHAU/KqLq0H4Fle1OJ7BTTt
5O7zo2jZx8I2sFEZ5Vlm8+1wgZk0qTq++7CAdBxsfw4Eo7bmuK/x
=iWvH
-----END PGP MESSAGE-----
<details> <summary>It helps the issue:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdATyv+PYuniG85WK3rODq4EhEn1npH1hS5seUxn2wIVWAw XjcrdTQThC6Vw4EGcYH+L8PaNAONZtn95YMSXRzUMvdUeqdCBUbbIpFHutxwLy7M 1LUBCQIQCoHoIFymQ/lN0nYMWBbRHhuqlMqCSvg/4PU7+rv7p5qvGtZyf5YznYPP E+PITKMwP/dE9qS7tcn41TS0jeNr14MD+vYuG3faDkOY6uGeN1OiAiKA1Tdiaxtf BoOn2ywQQ4A/XrpTvn3IiMFmIjejKFC4uxfeGUiAKgHAU/KqLq0H4Fle1OJ7BTTt 5O7zo2jZx8I2sFEZ5Vlm8+1wgZk0qTq++7CAdBxsfw4Eo7bmuK/x =iWvH -----END PGP MESSAGE----- ``` </details>
Author
Owner
adb shell 'hostname && echo a && \
    hostname && echo b'
Output:
localhost
a
localhost
b
Bash script:
adb shell '
    hostname && echo a && \
    hostname && echo b
'
Output:
localhost
a
localhost
b
Bash script:
adb shell '
    cd /data/local/tmp/
    LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/          
'

works fine on my Fairphone 4 own LineageOS 22.2 Termux.

I confirm that the execution flag is kept on adb push.

command-not-found
command-not-found: command not found
dpkg -L command-not-found
Output:
/.
/data
/data/data
/data/data/com.termux
/data/data/com.termux/files
/data/data/com.termux/files/usr
/data/data/com.termux/files/usr/libexec
/data/data/com.termux/files/usr/libexec/termux
/data/data/com.termux/files/usr/libexec/termux/command-not-found
/data/data/com.termux/files/usr/share
/data/data/com.termux/files/usr/share/doc
/data/data/com.termux/files/usr/share/doc/command-not-found
/data/data/com.termux/files/usr/share/doc/command-not-found/copyright
$PREFIX/libexec/termux/command-not-found inotifywait
Output:
The program inotifywait is not installed. Install it by executing:
 pkg install inotify-tools

DuckDuckGo search Termux mirrors.

termux/termux-packages/wiki/Mirrors/74f5c2abe11397d4b25f0c445425c6c7d917c36b

I just read Info for mirror maintainers section.

```bash adb shell 'hostname && echo a && \ hostname && echo b' ``` <details> <summary>Output:</summary> ``` localhost a localhost b ``` </details> <details> <summary>Bash script:</summary> ```bash adb shell ' hostname && echo a && \ hostname && echo b ' ``` </details> <details> <summary>Output:</summary> ``` localhost a localhost b ``` </details> <details> <summary>Bash script:</summary> ```bash adb shell ' cd /data/local/tmp/ LD_LIBRARY_PATH=. ./inotifywait -e CLOSE /sdcard/DCIM/Camera/ ' ``` </details> works fine on my Fairphone 4 own LineageOS 22.2 Termux. I confirm that the execution flag is kept on `adb push`. ``` command-not-found ``` ``` command-not-found: command not found ``` ``` dpkg -L command-not-found ``` <details> <summary>Output:</summary> ``` /. /data /data/data /data/data/com.termux /data/data/com.termux/files /data/data/com.termux/files/usr /data/data/com.termux/files/usr/libexec /data/data/com.termux/files/usr/libexec/termux /data/data/com.termux/files/usr/libexec/termux/command-not-found /data/data/com.termux/files/usr/share /data/data/com.termux/files/usr/share/doc /data/data/com.termux/files/usr/share/doc/command-not-found /data/data/com.termux/files/usr/share/doc/command-not-found/copyright ``` </details> ```bash $PREFIX/libexec/termux/command-not-found inotifywait ``` <details> <summary>Output:</summary> ``` The program inotifywait is not installed. Install it by executing: pkg install inotify-tools ``` </details> DuckDuckGo search *Termux mirrors*. [termux/termux-packages/wiki/Mirrors/74f5c2abe11397d4b25f0c445425c6c7d917c36b](https://github.com/termux/termux-packages/wiki/Mirrors/74f5c2abe11397d4b25f0c445425c6c7d917c36b) I just read *Info for mirror maintainers* section.
Author
Owner

https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/
https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/inotify-tools_4.25.9.0_aarch64.deb

DuckDuckGo and Google search Decompress .deb.

The Unix Stack Exchange answer 138190:

dpkg-deb --help | grep -A 2 -e '-R'
Output:
  -R|--raw-extract <deb> <directory>
                                   Extract control info and files.
  --ctrl-tarfile <deb>             Output control tarfile.
dpkg-deb -R inotify-tools_4.25.9.0_aarch64.deb
Output:
dpkg-deb: error: --raw-extract needs a target directory.
Perhaps you should be using dpkg --install ?

Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --help for help about installing and deinstalling packages.
dpkg-deb -R inotify-tools_4.25.9.0_aarch64.deb .

does not return anything.

tree
Output:
.
├── data
│   └── data
│       └── com.termux
│           └── files
│               └── usr
│                   ├── bin
│                   │   ├── fsnotifywait -> inotifywait
│                   │   ├── fsnotifywatch -> inotifywatch
│                   │   ├── inotifywait
│                   │   └── inotifywatch
│                   ├── include
│                   │   └── inotifytools
│                   │       ├── fanotify-dfid-name.h
│                   │       ├── fanotify.h
│                   │       ├── inotify.h
│                   │       ├── inotify-nosys.h
│                   │       └── inotifytools.h
│                   ├── lib
│                   │   └── libinotifytools.so
│                   └── share
│                       ├── doc
│                       │   └── inotify-tools
│                       │       └── copyright -> ../../LICENSES/GPL-2.0.txt
│                       └── man
│                           └── man1
│                               ├── fsnotifywait.1.gz
│                               ├── fsnotifywatch.1.gz
│                               ├── inotifywait.1.gz
│                               └── inotifywatch.1.gz
├── DEBIAN
│   └── control
└── inotify-tools_4.25.9.0_aarch64.deb

16 directories, 17 files
https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/ https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/inotify-tools_4.25.9.0_aarch64.deb DuckDuckGo and Google search *Decompress .deb*. [The Unix Stack Exchange answer 138190](https://unix.stackexchange.com/a/138190): ```bash dpkg-deb --help | grep -A 2 -e '-R' ``` <details> <summary>Output:</summary> ``` -R|--raw-extract <deb> <directory> Extract control info and files. --ctrl-tarfile <deb> Output control tarfile. ``` </details> ``` dpkg-deb -R inotify-tools_4.25.9.0_aarch64.deb ``` <details> <summary>Output:</summary> ``` dpkg-deb: error: --raw-extract needs a target directory. Perhaps you should be using dpkg --install ? Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --help for help about installing and deinstalling packages. ``` </details> ``` dpkg-deb -R inotify-tools_4.25.9.0_aarch64.deb . ``` does not return anything. ``` tree ``` <details> <summary>Output:</summary> ``` . ├── data │   └── data │   └── com.termux │   └── files │   └── usr │   ├── bin │   │   ├── fsnotifywait -> inotifywait │   │   ├── fsnotifywatch -> inotifywatch │   │   ├── inotifywait │   │   └── inotifywatch │   ├── include │   │   └── inotifytools │   │   ├── fanotify-dfid-name.h │   │   ├── fanotify.h │   │   ├── inotify.h │   │   ├── inotify-nosys.h │   │   └── inotifytools.h │   ├── lib │   │   └── libinotifytools.so │   └── share │   ├── doc │   │   └── inotify-tools │   │   └── copyright -> ../../LICENSES/GPL-2.0.txt │   └── man │   └── man1 │   ├── fsnotifywait.1.gz │   ├── fsnotifywatch.1.gz │   ├── inotifywait.1.gz │   └── inotifywatch.1.gz ├── DEBIAN │   └── control └── inotify-tools_4.25.9.0_aarch64.deb 16 directories, 17 files ``` </details>
Author
Owner

Wikipedia: Termux (1316517983) correctly denotes termux.dev as Website.

[Wikipedia: Termux (1316517983)](https://en.wikipedia.org/w/index.php?title=Termux&oldid=1316517983) correctly denotes `termux.dev` as *Website*.
Author
Owner
diff data/data/com.termux/files/usr/bin/inotifywait ~/inotifywait

does not return anything, same for libinotifytools.so.

dpkg -S $PREFIX/lib/libc++_shared.so
libc++: /data/data/com.termux/files/usr/lib/libc++_shared.so

https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb

tree
Output:
.
├── data
│   └── data
│       └── com.termux
│           └── files
│               └── usr
│                   ├── lib
│                   │   └── libc++_shared.so
│                   └── share
│                       └── doc
│                           └── libc++
│                               └── copyright -> ../../LICENSES/NCSA.txt
├── DEBIAN
│   └── control
└── libc++_28c-1_aarch64.deb

11 directories, 4 files

Same with libc++_shared.so.

``` diff data/data/com.termux/files/usr/bin/inotifywait ~/inotifywait ``` does not return anything, same for `libinotifytools.so`. ```bash dpkg -S $PREFIX/lib/libc++_shared.so ``` ``` libc++: /data/data/com.termux/files/usr/lib/libc++_shared.so ``` https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb ``` tree ``` <details> <summary>Output:</summary> ``` . ├── data │   └── data │   └── com.termux │   └── files │   └── usr │   ├── lib │   │   └── libc++_shared.so │   └── share │   └── doc │   └── libc++ │   └── copyright -> ../../LICENSES/NCSA.txt ├── DEBIAN │   └── control └── libc++_28c-1_aarch64.deb 11 directories, 4 files ``` </details> Same with `libc++_shared.so`.
Author
Owner

I would like my setup to resist reboots for #29.

adb shell touch /data/local/my_file
touch: '/data/local/my_file': Permission denied
I would like my setup to resist reboots for #29. ``` adb shell touch /data/local/my_file ``` ``` touch: '/data/local/my_file': Permission denied ```
Author
Owner

I checked that:

adb shell touch /data/local/tmp/my_file
adb shell ls -lh /data/local/tmp/
Output:
total 4
drwxrwxrwx 3 shell shell 4.0K 2025-06-02 16:32 dalvik-cache
-rw-rw-rw- 1 shell shell    0 2025-11-07 19:22 my_file

/data/local/tmp/my_file is still present after a reboot on my Debian 13 GNOME laptop Virtual Machine Manager LineageOS 22.2 virtual machine.

I checked that: ``` adb shell touch /data/local/tmp/my_file adb shell ls -lh /data/local/tmp/ ``` <details> <summary>Output:</summary> ``` total 4 drwxrwxrwx 3 shell shell 4.0K 2025-06-02 16:32 dalvik-cache -rw-rw-rw- 1 shell shell 0 2025-11-07 19:22 my_file ``` </details> `/data/local/tmp/my_file` is still present after a reboot on my Debian 13 GNOME laptop Virtual Machine Manager LineageOS 22.2 virtual machine.
Author
Owner

The Unix Stack Exchange answer 61464:

tar -xvf libc++_28c-1_aarch64.deb data/data/com.termux/files/usr/lib/libc++_shared.so
Output:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: data/data/com.termux/files/usr/lib/libc++_shared.so: Not found in archive
tar: Exiting with failure status due to previous errors

No matter if prefix with / or ./.

DuckDuckGo and Google search Linux extract given file from .xz.

[The Unix Stack Exchange answer 61464](https://unix.stackexchange.com/a/61464): ``` tar -xvf libc++_28c-1_aarch64.deb data/data/com.termux/files/usr/lib/libc++_shared.so ``` <details> <summary>Output:</summary> ``` tar: This does not look like a tar archive tar: Skipping to next header tar: data/data/com.termux/files/usr/lib/libc++_shared.so: Not found in archive tar: Exiting with failure status due to previous errors ``` </details> No matter if prefix with `/` or `./`. DuckDuckGo and Google search *Linux extract given file from .xz*.
Author
Owner
file libc++_28c-1_aarch64.deb
libc++_28c-1_aarch64.deb: Debian binary package (format 2.0), with control.tar.xz/, data compression xz

DuckDuckGo search Linux extract single file from .deb.

dpkg-deb --help | grep -i extract
Output:
  -e|--control <deb> [<directory>] Extract control info.
  -x|--extract <deb> <directory>   Extract files.
  -X|--vextract <deb> <directory>  Extract & list files.
  -R|--raw-extract <deb> <directory>
                                   Extract control info and files.
unpacked using 'dpkg-deb --extract' will be incorrectly installed !

The Ask Ubuntu answer 6022:

dpkg --help | grep -B 2 -A 2 'fsys-tarfile'
Output:

Use dpkg with -b, --build, -c, --contents, -e, --control, -I, --info,
  -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile
on archives (type dpkg-deb --help).

man dpkg | grep -A 2 fsys-tarfile
Output:
           --fsys-tarfile archive
               Output the filesystem tar-file contained by a Debian package.

tar --help | grep -Ee '-(x|O)',
Output:
  -x, --extract, --get       extract files from an archive
  -O, --to-stdout            extract files to standard output
dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar x ./data/data/com.termux/files/usr/lib/libc++_shared.so
tree data/
Output:
data/
└── data
    └── com.termux
        └── files
            └── usr
                └── lib
                    └── libc++_shared.so

6 directories, 1 file
dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar --strip-components=7 x ./data/data/com.termux/files/usr/lib/libc++_shared.so
Output:
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

Source: the Stack Overflow answer 845601

dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar --strip-components=7 -x ./data/data/com.termux/files/usr/lib/libc++_shared.so

works, but is quite unsatisfying.

``` file libc++_28c-1_aarch64.deb ``` ``` libc++_28c-1_aarch64.deb: Debian binary package (format 2.0), with control.tar.xz/, data compression xz ``` DuckDuckGo search *Linux extract single file from .deb*. ``` dpkg-deb --help | grep -i extract ``` <details> <summary>Output:</summary> ``` -e|--control <deb> [<directory>] Extract control info. -x|--extract <deb> <directory> Extract files. -X|--vextract <deb> <directory> Extract & list files. -R|--raw-extract <deb> <directory> Extract control info and files. unpacked using 'dpkg-deb --extract' will be incorrectly installed ! ``` </details> [The Ask Ubuntu answer 6022](https://askubuntu.com/a/6022): ```bash dpkg --help | grep -B 2 -A 2 'fsys-tarfile' ``` <details> <summary>Output:</summary> ``` Use dpkg with -b, --build, -c, --contents, -e, --control, -I, --info, -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile on archives (type dpkg-deb --help). ``` </details> ``` man dpkg | grep -A 2 fsys-tarfile ``` <details> <summary>Output:</summary> ``` --fsys-tarfile archive Output the filesystem tar-file contained by a Debian package. ``` </details> ``` tar --help | grep -Ee '-(x|O)', ``` <details> <summary>Output:</summary> ``` -x, --extract, --get extract files from an archive -O, --to-stdout extract files to standard output ``` </details> ``` dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar x ./data/data/com.termux/files/usr/lib/libc++_shared.so tree data/ ``` <details> <summary>Output:</summary> ``` data/ └── data └── com.termux └── files └── usr └── lib └── libc++_shared.so 6 directories, 1 file ``` </details> ``` dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar --strip-components=7 x ./data/data/com.termux/files/usr/lib/libc++_shared.so ``` <details> <summary>Output:</summary> ``` tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options Try 'tar --help' or 'tar --usage' for more information. dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) ``` </details> Source: [the Stack Overflow answer 845601](https://stackoverflow.com/a/845601) ``` dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar --strip-components=7 -x ./data/data/com.termux/files/usr/lib/libc++_shared.so ``` works, but is quite unsatisfying.
Author
Owner

Google search tar extract in current folder.

Google search *tar extract in current folder*.
Author
Owner
FILE=libc++_shared.so
dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE

does not return anything and works as wanted.

curl https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb | dpkg --fsys-tarfile | file -
Output:
dpkg-deb: error: --fsys-tarfile needs a .deb filename argument

Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --help for help about installing and deinstalling packages.
/dev/stdin: empty
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  284k    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (23) Failure writing output to destination, passed 16052 returned 0
curl https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE
Output:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  284k  100  284k    0     0   942k      0 --:--:-- --:--:-- --:--:--  940k

works as wanted.

```bash FILE=libc++_shared.so dpkg --fsys-tarfile libc++_28c-1_aarch64.deb | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE ``` does not return anything and works as wanted. ```bash curl https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb | dpkg --fsys-tarfile | file - ``` <details> <summary>Output:</summary> ``` dpkg-deb: error: --fsys-tarfile needs a .deb filename argument Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --help for help about installing and deinstalling packages. /dev/stdin: empty % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 284k 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (23) Failure writing output to destination, passed 16052 returned 0 ``` </details> ```bash curl https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++/libc++_28c-1_aarch64.deb | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE ``` <details> <summary>Output:</summary> ``` % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 284k 100 284k 0 0 942k 0 --:--:-- --:--:-- --:--:-- 940k ``` </details> works as wanted.
Author
Owner
FILE=libinotifytools.so
curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/inotify-tools_4.25.9.0_aarch64.deb | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE
curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/
Output:
<html>
<head><title>Index of /apt/termux-main/pool/main/i/inotify-tools/</title></head>
<body>
<h1>Index of /apt/termux-main/pool/main/i/inotify-tools/</h1><hr><pre><a href="../">../</a>
<a href="inotify-tools_4.25.9.0_aarch64.deb">inotify-tools_4.25.9.0_aarch64.deb</a>                 16-Sep-2025 12:20               36520
<a href="inotify-tools_4.25.9.0_arm.deb">inotify-tools_4.25.9.0_arm.deb</a>                     16-Sep-2025 12:20               34240
<a href="inotify-tools_4.25.9.0_i686.deb">inotify-tools_4.25.9.0_i686.deb</a>                    16-Sep-2025 12:20               36676
<a href="inotify-tools_4.25.9.0_x86_64.deb">inotify-tools_4.25.9.0_x86_64.deb</a>                  16-Sep-2025 12:20               37544
</pre><hr></body>
</html>
curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/ | grep -Po 'inotify-tools_[\d\.]+_aarch64.deb' | head -n 1
inotify-tools_4.25.9.0_aarch64.deb
Bash script:
FOLDER_URL=https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools
LIB_FILE=libinotifytools.so
DEB_FILE=`curl $FOLDER_URL/ | grep -Po 'inotify-tools_[\d\.]+_aarch64.deb' | head -n 1`
curl $FOLDER_URL/$DEB_FILE | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$LIB_FILE > $LIB_FILE
Bash script:
FOLDER_URL=https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++
LIB_FILE=libc++_shared.so
DEB_FILE=`curl $FOLDER_URL/ | grep -Po 'libc\+\+_[\da-z\-]+_aarch64.deb' | head -n 1`
curl $FOLDER_URL/$DEB_FILE | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$LIB_FILE > $LIB_FILE
Bash script:
CPU_ARCHITECTURE=x86_64
DEB_VERSION_FILE_REGEX="_[\da-z\-\.]+_$CPU_ARCHITECTURE.deb"
while IFS=, read <&3 -r folderUrl fileType file; do
  {
    lastFolderUrlComponent=`echo $folderUrl | cut -d '/' -f 2`
    folderUrl=https://packages.termux.dev/apt/termux-main/pool/main/$folderUrl
    debFile=`curl $folderUrl/ | grep -Po "$DEB_VERSION_FILE_REGEX" | head -n 1`
    if [ $fileType = "lib" ]
    then
        file=lib$file.so
    fi
    filePath=$fileType/$file
    curl $folderUrl/$lastFolderUrlComponent$debFile | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/$filePath > $file
    if [ $fileType = "bin" ]
    then
        chmod +x $file
    fi
    adb push $file /data/local/tmp/
  } 3<&-
done 3<< "EOF"
libc/libc++,lib,c++_shared
i/inotify-tools,lib,inotifytools
i/inotify-tools,bin,inotifywait
EOF

DuckDuckGo and Google search Linux command to escape regex and re.escape Bash equivalent.

Could cache on disk or RAM URLs to avoid redundant calls as currently due to inotify-tools, but it is quite unclear how to do so.

```bash FILE=libinotifytools.so curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/inotify-tools_4.25.9.0_aarch64.deb | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$FILE > $FILE ``` ```bash curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/ ``` <details> <summary>Output:</summary> ```html <html> <head><title>Index of /apt/termux-main/pool/main/i/inotify-tools/</title></head> <body> <h1>Index of /apt/termux-main/pool/main/i/inotify-tools/</h1><hr><pre><a href="../">../</a> <a href="inotify-tools_4.25.9.0_aarch64.deb">inotify-tools_4.25.9.0_aarch64.deb</a> 16-Sep-2025 12:20 36520 <a href="inotify-tools_4.25.9.0_arm.deb">inotify-tools_4.25.9.0_arm.deb</a> 16-Sep-2025 12:20 34240 <a href="inotify-tools_4.25.9.0_i686.deb">inotify-tools_4.25.9.0_i686.deb</a> 16-Sep-2025 12:20 36676 <a href="inotify-tools_4.25.9.0_x86_64.deb">inotify-tools_4.25.9.0_x86_64.deb</a> 16-Sep-2025 12:20 37544 </pre><hr></body> </html> ``` </details> ```bash curl https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools/ | grep -Po 'inotify-tools_[\d\.]+_aarch64.deb' | head -n 1 ``` ``` inotify-tools_4.25.9.0_aarch64.deb ``` <details> <summary>Bash script:</summary> ```bash FOLDER_URL=https://packages.termux.dev/apt/termux-main/pool/main/i/inotify-tools LIB_FILE=libinotifytools.so DEB_FILE=`curl $FOLDER_URL/ | grep -Po 'inotify-tools_[\d\.]+_aarch64.deb' | head -n 1` curl $FOLDER_URL/$DEB_FILE | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$LIB_FILE > $LIB_FILE ``` </details> <details> <summary>Bash script:</summary> ```bash FOLDER_URL=https://packages.termux.dev/apt/termux-main/pool/main/libc/libc++ LIB_FILE=libc++_shared.so DEB_FILE=`curl $FOLDER_URL/ | grep -Po 'libc\+\+_[\da-z\-]+_aarch64.deb' | head -n 1` curl $FOLDER_URL/$DEB_FILE | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/lib/$LIB_FILE > $LIB_FILE ``` </details> <details> <summary>Bash script:</summary> ```bash CPU_ARCHITECTURE=x86_64 DEB_VERSION_FILE_REGEX="_[\da-z\-\.]+_$CPU_ARCHITECTURE.deb" while IFS=, read <&3 -r folderUrl fileType file; do { lastFolderUrlComponent=`echo $folderUrl | cut -d '/' -f 2` folderUrl=https://packages.termux.dev/apt/termux-main/pool/main/$folderUrl debFile=`curl $folderUrl/ | grep -Po "$DEB_VERSION_FILE_REGEX" | head -n 1` if [ $fileType = "lib" ] then file=lib$file.so fi filePath=$fileType/$file curl $folderUrl/$lastFolderUrlComponent$debFile | dpkg --fsys-tarfile - | tar xO ./data/data/com.termux/files/usr/$filePath > $file if [ $fileType = "bin" ] then chmod +x $file fi adb push $file /data/local/tmp/ } 3<&- done 3<< "EOF" libc/libc++,lib,c++_shared i/inotify-tools,lib,inotifytools i/inotify-tools,bin,inotifywait EOF ``` </details> DuckDuckGo and Google search *Linux command to escape regex* and *re.escape Bash equivalent*. Could cache on disk or RAM URLs to avoid redundant calls as currently due to `inotify-tools`, but it is quite unclear how to do so.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/adb#52