파일 수 세기

태기·2023년 2월 2일
0

하위디렉토리까지 파일 수 세기

-> ls -alRr | wc -l

형식이 파일인 것 중에서 vi로 확인했을 때 hello 라는 단어가 있는 파일 개수

-> find -type f | wc -l ; grep -rin "hello" | wc -l

형식이 파일인 것 중에서 vi 확인했을 때 hello 라는 단어가 있는 파일 목록 개수

-> find -type f | wc -l ; grep -rin "hello"

파일 이름이 hello.pdf 개수

-> find -type f -name "hello.pdf" | wc -l

파일 이름이 hello.pdf가 아닌 개수

-> find -type f ! -name "hello.pdf" | wc -l

빈 디렉토리 개수

-> find . -empty -type d -print | wc -l

profile
경제적 자유를 향해

0개의 댓글