Goal: Remove every directory that lives directly inside the current directory (depth 1), including hidden directories. Delete them recursively. Do not remove files outside those directories.
Safety and notes:
Only immediate subdirectories are targeted. The current directory (.) and any files at depth 1 are preserved.
Hidden directories (starting with a dot) are included when present.
The operation is destructive. Ensure you are in the intended working directory before running commands.
Expected deliverables:
A transcript/log showing which directories were removed and the command outputs.
A final listing demonstrating that no immediate subdirectories remain (excluding . and ..).
Steps:
Identify the targets (directories at depth 1, including hidden):
find . -mindepth 1 -maxdepth 1 -type d -print
Delete them recursively (safe handling for names with spaces):
find . -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 rm -rf --
Verify the result:
find . -mindepth 1 -maxdepth 1 -type d -print; echo "Done"
Or simply ls -la to see remaining entries
Delivery:
A log file (e.g., action.log) containing the before and after directory listings and a count of removed directories.
The final directory listing showing no immediate subdirectories remain.