How Do I Delete All Files in a Directory Except One in Linux?
Contents

How do I select all files except one?

Select multiple files or folders that are not grouped together

  1. Click the first file or folder, and then press and hold the Ctrl key.
  2. While holding Ctrl , click each of the other files or folders you want to select.

31 дек. 2020 г.

How do I delete all files but not a folder?

How to delete files but not folders and folder structure containing them

  1. Right click on ‘shell’ folder and choose New -> Key, name the new sub key as ‘Empty Folder Contents’.
  2. Right click on ‘Empty Folder Contents’ and choose New -> Key, name the sub key as ‘Command’.
Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest