Posts

Showing posts from March, 2017

Sox of Silence - Original post - http://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/

Image
The SoX of Silence SoX is, by their own definition,  the Swiss Army knife of audio manipulation. And no doubt it’s full of fun with slicing and dicing and playback and recording and filtering and effects capabilities. But SoX is a command line tool, which means obscure syntax and parameters in order to get things done. I’ve been trying off and on for months to try to understand the  silence  filter from within SoX, which allows one to remove silence from the beginning, middle, or end of the audio. Sounds, simple, doesn’t it?  Well, it should be. Below is the  man page for the  silence  filter : silence  [-l] above-periods [duration threshold[d|%] [below-periods duration threshold[d|%]] Removes silence from the beginning, middle, or end of the audio. Silence is anything below a specified threshold. The above-periods value is used to indicate if audio should be trimmed at the beginning of the audio. A value of zero indicates no silence should be trimmed from the beg

Find number of files in all subdirectories

Here's a simple command in bash to do the same. for f in *; do [ -d ./"$f" ] && find ./"$f" -maxdepth 1 -exec echo \; | wc -l && echo $f; done Works with all file names. Enjoy :) Below commands are picked from the stackoverflow post:- http://unix.stackexchange.com/questions/4105/how-do-i-count-all-the-files-recursively-through-directories List folder with filecount find -maxdepth 1 -type d | sort | while read -r dir; do n=$(find "$dir" -type f | wc -l); printf "%4d : %s\n" $n "$dir"; done for f in */*; do echo "$f -> $(ls $f | wc -l)"; done List folder with Zero File Count find -maxdepth 1 -type d | sort | while read -r dir; do n=$(find "$dir" -type f | wc -l); if [ $n -gt 0 ]; then printf "%4d : %s\n" $n "$dir"; fi; done List folder with subfolder count find -maxdepth 1 -type d | sort | while read -r dir; do n=$(find "$dir" -type d | wc -l