My Conversations with AI
  • Home
  • About
Sign in Register

Linux Commands

A collection of 1 post
Linux Commands

what is the linux command to delete all the contents of a directory, but not the directory itself?

Delete Directory Contents To delete all the contents of a directory but not the directory itself in Linux, you can use the rm command with the wildcard * to target all files and folders within the directory. The command would look like this: rm -r directory_name/* Alternatively, you can use
25 May 2025 2 min read
Page 1 of 1
My Conversations with AI 2025 No Copyrights No Trademarks
  • Sign up
creativecommons.org