Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitk/60234ec3f0e2c73e72f228d515a09efc to your computer and use it in GitHub Desktop.
Save amitk/60234ec3f0e2c73e72f228d515a09efc to your computer and use it in GitHub Desktop.
# It will delete all the files with there names matching the regex at once.
ls | grep <regex> | xargs rm
# eg.
# If we have files in our folder as "file.txt", "example.php", "new.html", "file_one.rb"
# For deleting files with "file" in their names just execute
# ls | grep file | xargs rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment