PG1X WIKI

My Knowledge Base

User Tools

Site Tools


junk:memo

Junk Memos

findで特定のディレクトリを除外 - Qiita
findコマンドで特定のディレクトリ以下を無視する方法 - mollifier delta blog

sudo find /data/ -type d -name rsnapshot -prune -o -type f -print >file-list-$(date +%Y%m%d_%H%M%S).txt
sudo find /data/ -type d -name rsnapshot -prune -o -type d -name /data/backup/lasthope/ -prune -o -type f -print >file-list-$(date +%Y%m%d_%H%M%S).txt

find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time. Did you mean ‘-wholename’?

sudo find /data/ -type d -name rsnapshot -prune -o -type d -wholename /data/backup/lasthope/ -prune -o -type f -print >file-list-$(date +%Y%m%d_%H%M%S).txt

find: warning: -wholename /data/backup/lasthope/ will not match anything because it ends with /.

sudo find /data/ -type d -name rsnapshot -prune -o -type d -wholename /data/backup/lasthope -prune -o -type f -print >file-list-$(date +%Y%m%d_%H%M%S).txt
junk/memo.txt · Last modified: 2021/09/19 15:54 by wnoguchi