Linux: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
;How to print a file, excluding comments and blank lines, using grep | ;How to print a file, excluding comments and blank lines, using grep | ||
<pre>grep -v '^$\|^#\|^\s*\#' filename | grep -v "^[[:space:]]*$" | more</pre> | <pre>grep -v '^$\|^#\|^\s*\#' filename | grep -v "^[[:space:]]*$" | more</pre> | ||
;[[Audiofile operations]] | |||
Revision as of 19:41, 27 April 2022
- Copy directories without content
rsync -av -f"+ */" -f"- *" "$source" "$target"
- Delete Files older Than
find /var/log -name "*.log" -type f -mtime +30 -delete <br>
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