I'm trying to monitor a file that will get downloaded by another process using ls -haltd
. When I run the watch
command the execution fails.
e.g.
$ watch ls -halt myfile.txt
-bash: /usr/bin/watch: cannot execute binary file: Exec format error
I've checked to make sure there are no aliases for watch
(there are no aliases for anything)
I've checked the binary with file
$ file `which watch`
/usr/bin/watch: ELF 64-bit (SYSV)
and I've verified my OS as
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
$ uname -a
Linux valhalla 5.4.0-1053-raspi #60-Ubuntu SMP PREEMPT Fri Feb 11 07:18:29 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
The machine is built of the same image as many others and I'm not having this issue elsewhere. Before I go off modifying the config of a production server, any thoughts on the cause of this?
watch 'ls -halt myfile.txt'
... ie. pass thels -halt myfile.txt
as a single parameter instead of as multiple parameters ; ie. your command caused-halt
andmyfile.txt
to not be part of thels
command you gave as a parameter but get treated as extra operands ofwatch
...ELF 64-bit (SYSV)
the complete output of thefile
command? does it not mention an interpreter at all?