rm directory command line code example Example 1: how to forcefully delete a directory in linux rm -rf dirname Example 2: bash remove directory rm -rf directory-name