User Tools

Site Tools


how_to_count_all_the_files_in_a_directory

How to count all the files in a directory

2016



  ls -l -R /path | wc -l



Or:

  find "/home/charles/testarea" -daystart -type f -mtime +6 | wc -l



Or:

#Delete subfolders from “/home/charles/testarea”

#clear terminal window
echo -e “\033c”

find “/home/charles/testarea” -mindepth 1 -mtime +6 -type d | while read x; do echo “———” ; echo Deleting folder “$x” ; rm -R “$x”;

done

how_to_count_all_the_files_in_a_directory.txt · Last modified: 2017/02/28 18:00 (external edit)