DEV Community

Cover image for Clear command not found inside docker container ?
SHUBHENDU SHUBHAM
SHUBHENDU SHUBHAM

Posted on

1

Clear command not found inside docker container ?

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

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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 !

Top comments (0)