Skip to main content
I guess you meant "find"? ;)
Source Link
slhck
  • 230.2k
  • 71
  • 621
  • 603

Use the following to list all the files that would be removed (just to be sure):

filesfind /path/to/directory -mindepth 1 ! -name "*dist"

Add -type f if you only want to delete regular files, not symbolic links or directories.


Run the command with additional -delete argument at the end to remove them.

Use the following to list all the files that would be removed (just to be sure):

files /path/to/directory -mindepth 1 ! -name "*dist"

Add -type f if you only want to delete regular files, not symbolic links or directories.


Run the command with additional -delete argument at the end to remove them.

Use the following to list all the files that would be removed (just to be sure):

find /path/to/directory -mindepth 1 ! -name "*dist"

Add -type f if you only want to delete regular files, not symbolic links or directories.


Run the command with additional -delete argument at the end to remove them.

added 103 characters in body
Source Link
Daniel Beck
  • 110.8k
  • 16
  • 290
  • 337

Use the following to list all the files that would be removed (just to be sure):

files /path/to/directory -mindepth 1 ! -name "*dist"

Add -type f if you only want to delete regular files, not symbolic links or directories.


Run the command with additional -delete argument at the end to remove them.

Use the following to list all the files that would be removed (just to be sure):

files /path/to/directory -mindepth 1 ! -name "*dist"

Run the command with additional -delete argument at the end to remove them.

Use the following to list all the files that would be removed (just to be sure):

files /path/to/directory -mindepth 1 ! -name "*dist"

Add -type f if you only want to delete regular files, not symbolic links or directories.


Run the command with additional -delete argument at the end to remove them.

Source Link
Daniel Beck
  • 110.8k
  • 16
  • 290
  • 337

Use the following to list all the files that would be removed (just to be sure):

files /path/to/directory -mindepth 1 ! -name "*dist"

Run the command with additional -delete argument at the end to remove them.