The documentation for
timeout is tricky in a way. If you refer it carefully it says
$ timeout --help
Usage: timeout [OPTION] DURATION COMMAND [ARG]...
or: timeout [OPTION]
Start COMMAND, and kill it if still running after DURATION.
Here the option
-k itself takes a value followed by a value needed for
DURATION also, so your command should two values back to back when using
-k as below. The error is thrown because
DURATION is a mandatory argument to be used.
timeout --kill-after=2 2 ls /mnt/ftp/;
The first option
--kill-after=2 is part of the
OPTION flag to the command which takes value
2 and the
DURATION itself takes a value
timeout -k 2 2 ls /mnt/ftp/;