[LINUX] tar, find, ps/pstat, grep, mv

Posted on 2009. 5. 12. 13:36
Filed Under LINUX+UNIX

파일명 변경&이동
mv fname_old  fname_new

하위 디렉토리의 파일까지 검색
#ls -lRs

폴더명/ 밑의 모든 파일 압축
tar -cvf 압축파일명.tar  폴더명/
압축 해제
tar xvzpf  filename.gz

디렉토리 찾기
find /user1/ -name '키워드' -type d
파일명 검색
#find /home -name "*.txt" -print                  ; /home 부터 *.txt인 모든 파일 검색
#find . -name "*.txt" -exec rm '{}' \;          ; 검색해서 삭제하기

프로세스 목록 조회/죽이기
ps -ef |grep 키워드
pstat
kill

파일내용 검색
#grep NW d*          ;파일 d*에서 NW를 모두 검색
#grep -n '^n' datefile   ; n으로 시작하는 모든 행을 출력
#grep -n '4$' datafile    ; 4로 끝나는 모든 행을 출력
-n ;행번호 출력
-i  ;대소문자 구분안함.


<참고>
ls, cp, .. : http://blog.naver.com/jhjl023/110029702888
ps, kill, top: http://blog.naver.com/yswon72/91064679
반응형

About

by 쑤기c

반응형