adb shell su works but adb root does not

By design adb root command works in development builds only (i.e. eng and userdebug which have ro.debuggable=1 by default). So to enable the adb root command on your otherwise rooted device just add the ro.debuggable=1 line to one of the following files: /system/build.prop /system/default.prop /data/local.prop If you want adb shell to start as root by … Read more

how do I use the grep –include option for multiple file types?

You can use multiple –include flags. This works for me: grep -r –include=*.html –include=*.php –include=*.htm “pattern” /some/path/ However, you can do as Deruijter suggested. This works for me: grep -r –include=*.{html,php,htm} “pattern” /some/path/ Don’t forget that you can use find and xargs for this sort of thing too: find /some/path/ -name “*.htm*” -or -name “*.php” … Read more

Padding characters in printf

Pure Bash, no external utilities This demonstration does full justification, but you can just omit subtracting the length of the second string if you want ragged-right lines. pad=$(printf ‘%0.1s’ “-“{1..60}) padlength=40 string2=’bbbbbbb’ for string1 in a aa aaaa aaaaaaaa do printf ‘%s’ “$string1” printf ‘%*.*s’ 0 $((padlength – ${#string1} – ${#string2} )) “$pad” printf ‘%s\n’ … Read more