Linux
Appearance
- Copy directories without content
rsync -av -f"+ */" -f"- *" "$source" "$target"
- Delete Files older Than
find /var/log -name "*.log" -type f -mtime +30 -delete
find /var/log -type d -mtime +30 -exec rm -rf {} \;
- How to print a file, excluding comments and blank lines, using grep
grep -v '^$\|^#\|^\s*\#' filename | grep -v "^[[:space:]]*$" | more