Skip to content

Instantly share code, notes, and snippets.

@andreisfedotov
Created April 18, 2019 23:15
Show Gist options
  • Save andreisfedotov/98517af07676c0e84f64c26f0df735b6 to your computer and use it in GitHub Desktop.
Save andreisfedotov/98517af07676c0e84f64c26f0df735b6 to your computer and use it in GitHub Desktop.
find "$1" -maxdepth 1 -type f -iname "*$2*" #поиск файлов, в имени которых есть введенные символы
rm -f `find "$1" ! -name "*$2*" -type f -exec rm -f {} \;` #удаление файлов, которые не содержат введенные символы
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment