Find by Size in Shell

Level 238 keystrokes

find lists the .log files larger than 1 MiB under the current directory. The results are not sorted.

Shell code

# Looks for regular files (-type f) named *.log under the current directory
# -size +1M keeps only files larger than 1 MiB; all tests must match (AND)
1find . -type f -name "*.log" -size +1M

Output

./logs/app.log
./logs/error.log
./logs/access.log
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.

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

More Shell examples at level 2

← Shell typing practice