Search files & directories on Linux

Terminal

Today we will learn how to search files and directories filtered with various parameters.


The command we use is find. Consider a few examples:



# find / -name -iname '*hta*' -size +100M -mtime +3

search:

  • The complete system (/)

  • All files or directories containing hta ('hta')

  • Ignoring case (-iname)

  • With size larger than 100MB (-size +100 M)

  • Files modified more than 3 days



# find / -empty

Find files and empty directories (-empty)

As a final command, the following will search the folder sizes ordered from lowest to highest:



# du -hs $(du -s * | sort -g | awk '{print $2}')

Link: BUSCANDO FICHEROS EN GNU/LINUX: COMANDO FIND

Link: TamaƱo de las carpetas ordenado de menor a mayor


We request your permission to obtain statistical data on its navigation on this website. If you continue to browse we consider to accept the use of cookies. OK | More Information