Image description

if you're inside docker container using cli trying to modify files and wanna clear yout terminal , you tried ctl + l or clear command but getting response like

bash: clear: command not found

don't worry it's due to container nature, since it always install bare minimum utilities so we can manually install linux utility to work smoothly .

  1. Find out container os image
bash-5.2# cat /etc/os-release

Image description

here in my case Wazuh Manager container is running on Amazon Linux, which is based on Fedora, the package manager to use is dnf.

  1. now we can install clear utility in you container by following steps

Install util-linux package it contains the clear command

dnf install util-linux -y

Image description

or else you can install ncurses

Image description

See Clear command will work now .

before

Image description

After

Image description

keep Learning, Keep Troubleshooting !