Can someone explain the syntax of the following commands? II know what they do but was having a hard time getting the syntax,find / -type f -exec grep -H 'text-to-find-here' {} \;cat access.log | cut -d '' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -rsudo cat error_log.20150205 | grep mpmstat | grep -v , | cut -d: -f4- | grep -v :   | sed -e's/rdy//g' |  sed -e 's/bsy\|wr\|ka\|log\|dns\|cls\|rd/,/g
Please explain the syntax
scripting
find     / → Search from root     -type f → only select file (f)     -exec ....{} \; → execute the command inserting the found (file) names for {} one by one     grep -H 'test-to-find → execute this grep on every file found by findcat access.log | → output file to stdout and pipe into next command     cut -d '' -f3 | → split lines on  and output only field 3, pipe into next command     cut -d ' ' -f2 | → cut field 3 based on spaces and take second field, pipe into next     sort | uniq | sort -r → sort the output, remove duplicates, sort in reverse order (-r)(this last one can be done with some sort versions with sort -ur in one command, and the first one is a superfluous cat as you can write < access.log cut -d '' | .... )sudo cat error_log.20150205 | → execute cat with root permission (access rights on the file?)     grep mpmstat | → only select lines with the word mpmstat     grep -v , | → deselect (-v) any line with a comma     cut -d: -f4- | → split into fields based on ':' as delimiter, take fields nr 4 and up.     grep -v : | → suppress lines with ':' (unlikely there as this was the split character before)     sed -e's/rdy//g' | →  replace s the sequence rdy with nothing all over (g) each line     sed -e 's/bsy\|wr\|ka\|log\|dns\|cls\|rd/,/g →  replace various alternatives (bsy,wr, etc, separated by\|`) by a comma 