![find를 사용할 때 "경로가 표현식보다 앞에 있어야 합니다"는 무엇을 의미합니까? 명령에 작은따옴표를 포함했습니다.](https://linux55.com/image/216213/find%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EB%95%8C%20%22%EA%B2%BD%EB%A1%9C%EA%B0%80%20%ED%91%9C%ED%98%84%EC%8B%9D%EB%B3%B4%EB%8B%A4%20%EC%95%9E%EC%97%90%20%EC%9E%88%EC%96%B4%EC%95%BC%20%ED%95%A9%EB%8B%88%EB%8B%A4%22%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9D%84%20%EC%9D%98%EB%AF%B8%ED%95%A9%EB%8B%88%EA%B9%8C%3F%20%EB%AA%85%EB%A0%B9%EC%97%90%20%EC%9E%91%EC%9D%80%EB%94%B0%EC%98%B4%ED%91%9C%EB%A5%BC%20%ED%8F%AC%ED%95%A8%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
명령이 find / -printf ‘%s %p\n’| sort -nr | head -10
다음 오류와 함께 반환됩니다.
find: paths must precede expression: %pn'
위의 명령은 다음에서 찾을 수 있습니다.https://www.techrepublic.com/article/how-to-free-disk-space-on-linux-systems/7단계
CentOS 7을 사용하고 있습니다. 명령은 를 type find
반환합니다 find is hashed (/usr/bin/find)
.
find
버전은 다음과 같습니다:
$ find -version
find (GNU findutils) 4.5.11
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://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.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX FTS(FTS_CWDFD) CBO(level=2)
답변1
잘못 복사한 웹사이트에서 인쇄상의 인용부호 ‘
와 를 사용하고 있습니다 ’
. 직선 인용부호를 사용해야 합니다 '
.
find / -printf '%s %p\n' | sort -nr | head -10
이 변경이 없으면 별도의 매개변수 와 을 find
받게 됩니다 . 첫 번째는 적용되고 두 번째는 고아가 되어 잘못된 경로 매개변수로 처리되어 오류 메시지가 표시됩니다.‘%s
%p\n’
-printf