Skip to content

Instantly share code, notes, and snippets.

@Matrix7867
Last active September 5, 2022 07:13
Show Gist options
  • Save Matrix7867/fe402ce2f1852fbe928fa8c983b4990c to your computer and use it in GitHub Desktop.
Save Matrix7867/fe402ce2f1852fbe928fa8c983b4990c to your computer and use it in GitHub Desktop.
deleting files starting from cd-* bash for loop
for i in cd-*; do ls $i; done
#The above command to check that all the files which are starting from cd-* is listing or not.
for i in cd-*; do sudo rm $i; done
#The above command will delete all the files which start with `cd-`.
#Note: sudo command is not needed if you are performing the above command as `root` or `privileged user`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment