find -size 1c
will give you all files that are exactly one byte.
As @user1666959 mentions, you can also use find . -type f -size -4c
, which will find all files in the current directory (and subdirectories), that are 4 bytes and smaller.
$ find . -maxdepth 1 -type f -size -4c -exec mv {} temp/ \;
(Yes, you will need the trailing \;
.
Note that find -size
allows for other exact file size matches (such as 1k
), but also allows you to search for files that take up the designated number of blocks on the disk (leaving off the unit).
$ man find
Provides a heap more info about how to use it to search.
-maxdepth 1
is probably quite important, otherwise it would find the ones you've already moved! – Hypostasize