Size of all the directories, files etc in the current directory in human-readable format.
du -sh *
command to know the free space in the disk:
df -h .
https://unix.stackexchange.com/a/185777
find the size of specific set of files
du -ch /var/log/elasticsearch/elasticsearch-2017-08-2*.log | grep total
to find the size of directories and files
du -h *
For finding the files by size
find -type f -exec du -Sh {} + | sort -rh | head -n 5
How to remove folders with a certain name
find -type d -name a -exec rm -rf {} ;
eg: if from a folder having multiple projects, you want to remove all the "node_modules" folder, use the command as below:
find -type d -name node_modules -exec rm -rf {} ;
the first part of this command (ie up to "find -type d -name node_modules" will show all the paths to the node_modules). then the second part of the command (exec rm -rf {} ;) will remove those folders
more in the below link: https://stackoverflow.com/questions/13032701/how-to-remove-folders-with-a-certain-name
For finding the files by size
find -type f -exec du -Sh {} + | sort -rh | head -n 5