Jump to content

Linux

From Costa's Wiki
Revision as of 22:22, 23 May 2022 by 172.17.0.1 (talk)
Copy directories without content
rsync -av -f"+ */" -f"- *" "$source" "$target"
Find files
find /path/to/dir -type f -name "*" -newermt 2013-02-07 ! -newermt 2013-02-08
find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -print
find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -ls
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
Audiofile operations
LVM operations
SSL Certificate with SAN