Find Files in Shell

Level 228 keystrokes

find lists all .txt files under the current directory, recursively. The results are not sorted, so their order may differ.

Shell code

# Searches . and all its subdirectories for regular files (-type f)
# whose name ends in .txt; the quotes keep the shell from expanding * first
1find . -name "*.txt" -type f

Output

./docs/readme.txt
./src/notes.txt
./data/config.txt
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Shell code and how often they appear.

  • -× 2
  • .× 2
  • "× 2
  • *× 1

More Shell examples at level 2

← Shell typing practice