Common Linux Command On Files Nov 28, 2016 Ningthoujam Lokhendro linux Finding files Using find Using grep Listing files size in decending order Finding files Using find # find all files under `/` with name starting with `index` find / -name "index*" # filter with size find /home -size +10000k # more then 10 Mb find /home -size -10000k # less then 10 Mb # filter with access time find /home -amin -10 # 10 min ago find /home -atime -10 # 10 hours ago # filter with modified time find /home -mmin -10 # 10 min ago find /home -mtime -10 # 10 hours ago # execute some cmd on the result of the find $ find / - name 'index*' -exec ls -l {\}\ \; # ls -l Using grep Find files containing specific pattern of string. grep -Iri "mycooltext" /path # Only certain file extension grep --include=\*.{yaml,yml} -irnw '/' -e "redis" # use `--exclude` when excluding certain file pattern. grep --exclude=\*.{log,out} -irnw '/' -e "redis" Listing files size in decending order du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh - Related posts - Apache mod_rewrite Booting Vagrant Increase the size of linux lvm by adding new disk - Recent posts - JVM and GC Jekyll with dockers Generate Self Sign SSL Certificate Spring Redis Sentinel Connection Common OpenSSL commands All posts