Skip to content

Instantly share code, notes, and snippets.

@maximgrynykha
Created September 30, 2023 16:22
Show Gist options
  • Save maximgrynykha/a53e244c266a3ab3812afeb7d9937e1c to your computer and use it in GitHub Desktop.
Save maximgrynykha/a53e244c266a3ab3812afeb7d9937e1c to your computer and use it in GitHub Desktop.
Find all tmp.txt file(s) with numeric name / Extract file name from path(s) / Count number of file(s)
#!/bin/bash
find ~ -name "tmp*.txt" | rev | cut -d "/" -f 1 | rev | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment