Skip to content

Instantly share code, notes, and snippets.

@matoken
Created August 21, 2018 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matoken/ab3cc2cde7eb2b409a6140bae97ec54c to your computer and use it in GitHub Desktop.
Save matoken/ab3cc2cde7eb2b409a6140bae97ec54c to your computer and use it in GitHub Desktop.
多分 ~ 以下の '.*.sw?' を検索,ただし "$HOME/.gvfs" 以下は無視としたいのだと思います.
手元ではこれでokそうでした.
$ find ~ -type d -path ~/.gvfs -prune -o -type f -name '*.sw*' -print
- $HOME を ~ に統一(多分動作には関係ない)
- ".swp" のパターンが引っかからなかったので -name '*.sw*' に
- -print0 は人間の目に厳しいので -print に(多分動作には関係ない)
とりあえず -print0 から -print に変更して確認してみてはどうでしょう
試した環境
$ find --version
find (GNU findutils) 4.6.0.187-5dae
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
有効になっている機能: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
$ dpkg-query -W findutils
findutils 4.6.0+git+20180808-2
$ lsb_release -d
Description: Debian GNU/Linux unstable (sid)
$ uname -m
x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment