디렉토리에 있는 확장자를 가진 모든 파일을 나열하는 가장 좋은 방법은 무엇입니까? [복사]

디렉토리에 있는 확장자를 가진 모든 파일을 나열하는 가장 좋은 방법은 무엇입니까? [복사]

몇 가지 연구 끝에 마침내 몇 가지 방법을 찾았습니다. 가장 논리적인 것은,

muyustan@muyustan-ubuntu:~/Downloads$ find . -name "*.srt"

하지만 이 명령의 출력은반품작업 디렉터리의 하위 디렉터리에 파일을 포함합니다.나는 그렇게 하지 않을 것이다.

./The.Walking.Dead.S10E11.Morning.Star.720p.AMZN.WEB-DL.DD+5.1.H.264.srt
./the.walking.dead.s10e12.web.h264-xlf.srt
./The.Walking.Dead.S10E11.1080p.WEB.H264-XLF.srt
./fs9s/Friends - [9x04] - The One with the Sharks.srt
./fs9s/Friends - [9x16] - The One with the Boob Job.srt
./fs9s/Friends - [9x17] - The One with the Memorial Service.srt
./fs9s/Friends - [9x03] - The One with the Pediatrician.srt
./fs9s/Friends - [9x02] - The One Where Emma Cries.srt
./fs9s/Friends - [9x21] - The One with the Fertility Test.srt
./fs9s/Friends - [9x01] - The One Where No One Proposes.srt
./fs9s/Friends - [9x18] - The One with the Lottery.srt
./fs9s/Friends - [9x12] - The One with Phoebe's Rats.srt
./fs9s/Friends - [9x11] - The One Where Rachel Goes Back to Work.srt
./fs9s/Friends - [9x15] - The One with the Mugging.srt
./fs9s/Friends - [9x09] - The One with Rachel's Phone Number.srt
./fs9s/Friends - [9x07] - The One with Ross's Inappropriate Song.srt
./fs9s/Friends - [9x05] - The One with Phoebe's Birthday Dinner.srt
./fs9s/Friends - [9x08] - The One with Rachel's Other Sister.srt
./fs9s/Friends - [9x14] - The One with the Blind Dates.srt
./fs9s/Friends - [9x13] - The One Where Monica Sings.srt
./fs9s/Friends - [9x19] - The One with Rachel's Dream.srt
./fs9s/Friends - [9x20] - The One with the Soap Opera Party.srt
./fs9s/Friends - [9x06] - The One with the Male Nanny.srt
./fs9s/Friends - [9x22] - The One With The Donor.srt
./fs9s/Friends - [9x10] - The One with Christmas in Tulsa.srt
muyustan@muyustan-ubuntu:~/Downloads$ 

따라서 누군가 나에게 이 작업을 수행할 수 있는 깔끔한 방법을 제공할 수 있다면 매우 감사할 것입니다.

답변1

대신 나열하고 싶다면스크립트 만들기, ls *.src할 것입니다.

관련 정보