다음과 중복될 수 있습니다.작동하지 않는 것으로 확인됨, 하지만 저는 신규 회원이기 때문에 해당 질문에 대한 답변을 언급하는 대신 새로운 질문을 하고 싶습니다. 다른 방법으로 했다면 저와 LMK를 용서해주세요.
find
Windows 10 WSL/Debian 시스템에서 다양한 명령을 실행하면 다음이 표시됩니다.
kenny@pc-name:/mnt/v$ find . -type f ! -iname "*.avi"
find: ‘.’: Invalid argument
kenny@pc-name:/mnt/v$ find /mnt/v -type f ! -iname "*.avi"
find: ‘/mnt/v’: Invalid argument
...5 other attempts to use the same command with other completely-valid paths, with the same result
kenny@pc-name:/mnt/v$ find --version
find (GNU findutils) 4.6.0.225-235f
...other irrelevant lines spat out by --version
보시다시피, 이 질문은 위에 링크된 질문과 다릅니다.예GNU 찾기를 실행하세요. 내가 생각할 수 있는 유일한 설명은 이것이 베어 메탈에서 실행되는 순수 데비안이 아니라 WSL/Debian 시스템이라는 것입니다.
어떤 조언이라도 대단히 감사하겠습니다. 감사합니다! :-)
고쳐 쓰다:@Wildcard의 의견에 대한 추가 테스트 결과는 다음과 같습니다.
kenny@pc-name:/mnt/v$ find --help
Usage: find [-H] [-L] [-P] [-Olevel] [-D debugopts] [path...] [expression]
default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:
operators (decreasing precedence; -and is implicit where no others are given):
( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2
EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2
positional options (always true): -daystart -follow -regextype
normal options (always true, specified before other expressions):
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
--version -xdev -ignore_readdir_race -noignore_readdir_race
tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME
-ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN
-links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE
-nouser -nogroup -path PATTERN -perm [-/]MODE -regex PATTERN
-readable -writable -executable
-wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
-used N -user NAME -xtype [bcdpfls] -context CONTEXT
actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print
-fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit
-exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
-execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;
Valid arguments for -D:
exec, opt, rates, search, stat, time, tree, all, help
Use '-D help' for a description of the options, or see find(1)
Please see also the documentation at http://www.gnu.org/software/findutils/.
You can report (and track progress on fixing) bugs in the "find"
program via the GNU findutils bug-reporting page at
https://savannah.gnu.org/bugs/?group=findutils or, if
you have no web access, by sending email to <[email protected]>.
kenny@pc-name:/mnt/v$ find /mnt/c/Users/Kenny/Desktop -type f -name *.txt
/mnt/c/Users/Kenny/Desktop/info.txt
/mnt/c/Users/Kenny/Desktop/phone.txt
/mnt/c/Users/Kenny/Desktop/Uber.txt
kenny@pc-name:/mnt/v$ find /mnt/c/Users/Kenny/Desktop -type f -iname *.txt
/mnt/c/Users/Kenny/Desktop/info.txt
/mnt/c/Users/Kenny/Desktop/phone.txt
/mnt/c/Users/Kenny/Desktop/test.TXT
/mnt/c/Users/Kenny/Desktop/Uber.txt
kenny@pc-name:/mnt/v$ find /mnt/c/Users/Kenny/Desktop -type f -not -iname *.txt
/mnt/c/Users/Kenny/Desktop/desktop.ini
/mnt/c/Users/Kenny/Desktop/test.AVI
/mnt/c/Users/Kenny/Desktop/test.MKV
/mnt/c/Users/Kenny/Desktop/test.MP4
/mnt/c/Users/Kenny/Desktop/test.PDF
kenny@pc-name:/mnt/v$ find /mnt/v -type f -not -iname *.txt
find: ‘/mnt/v’: Bad file descriptor
kenny@pc-name:/mnt/v$ find . -type f -not -iname *.txt
find: ‘.’: Bad file descriptor
보시 find
다시피 C: 드라이브에서 반복하여 올바른 파일을 찾는 데 아무런 문제가 없습니다. 문제는 sudo mount -t drvfs '\\192.168.1.1\Videos' /mnt/v
. t 이 WSL 시스템에 다른 변경 사항을 적용하세요! :에스