- Community Home
- >
- HPE Community, Korea
- >
- HP-UX
- >
- 패턴방식으로 파일 삭제하는 방법...
HP-UX
1752778
회원
5974
온라인
108789
솔루션
포럼
범주
Company
Local Language
뒤로
포럼
토론 게시판
포럼
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
토론 게시판
토론 게시판
포럼
토론 게시판
뒤로
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
블로그
정보
커뮤니티 언어
언어
포럼
블로그
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 06-08-2005 10:00 PM
날짜: 06-08-2005 10:00 PM
패턴방식으로 파일 삭제하는 방법...
total 215658
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10004.trc
-rw-r--r-- 1 oracle dba 201 May 10 17:17 PLSExtProc_agt_10017.trc
-rw-r--r-- 1 oracle dba 201 May 25 19:43 PLSExtProc_agt_10090.trc
-rw-r--r-- 1 oracle dba 201 May 20 17:51 PLSExtProc_agt_101.trc
-rw-r--r-- 1 oracle dba 201 May 24 22:43 PLSExtProc_agt_10108.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10112.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:33 PLSExtProc_agt_10121.trc
-rw-r--r-- 1 oracle dba 201 May 4 13:41 PLSExtProc_agt_10135.trc
-rw-r--r-- 1 oracle dba 201 May 10 17:17 PLSExtProc_agt_10205.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10227.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10302.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10358.trc
-rw-r--r-- 1 oracle dba 201 May 24 22:43 PLSExtProc_agt_10370.trc
-rw-r--r-- 1 oracle dba 201 May 10 21:13 PLSExtProc_agt_10380.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:33 PLSExtProc_agt_10411.trc
-rw-r--r-- 1 oracle dba 201 May 30 16:33 PLSExtProc_agt_10430.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10445.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 20:05 PLSExtProc_agt_10454.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 20:05 PLSExtProc_agt_10455.trc
위의 파일의 패턴을 보면 날짜가 May 와 jun 두가지 있는데..
저는 파일을 May 만 골라서 한꺼번에 삭제하고 싶습니다.
위와 같은 파일이 수만개정도 되는데..일일이 삭제하기는 엄두가 나지 않아서 간단한 shell script로 일괄적으로 삭제하는 방법이 없을까요..
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10004.trc
-rw-r--r-- 1 oracle dba 201 May 10 17:17 PLSExtProc_agt_10017.trc
-rw-r--r-- 1 oracle dba 201 May 25 19:43 PLSExtProc_agt_10090.trc
-rw-r--r-- 1 oracle dba 201 May 20 17:51 PLSExtProc_agt_101.trc
-rw-r--r-- 1 oracle dba 201 May 24 22:43 PLSExtProc_agt_10108.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10112.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:33 PLSExtProc_agt_10121.trc
-rw-r--r-- 1 oracle dba 201 May 4 13:41 PLSExtProc_agt_10135.trc
-rw-r--r-- 1 oracle dba 201 May 10 17:17 PLSExtProc_agt_10205.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10227.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10302.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:35 PLSExtProc_agt_10358.trc
-rw-r--r-- 1 oracle dba 201 May 24 22:43 PLSExtProc_agt_10370.trc
-rw-r--r-- 1 oracle dba 201 May 10 21:13 PLSExtProc_agt_10380.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 16:33 PLSExtProc_agt_10411.trc
-rw-r--r-- 1 oracle dba 201 May 30 16:33 PLSExtProc_agt_10430.trc
-rw-r--r-- 1 oracle dba 201 May 17 19:38 PLSExtProc_agt_10445.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 20:05 PLSExtProc_agt_10454.trc
-rw-r--r-- 1 oracle dba 201 Jun 8 20:05 PLSExtProc_agt_10455.trc
위의 파일의 패턴을 보면 날짜가 May 와 jun 두가지 있는데..
저는 파일을 May 만 골라서 한꺼번에 삭제하고 싶습니다.
위와 같은 파일이 수만개정도 되는데..일일이 삭제하기는 엄두가 나지 않아서 간단한 shell script로 일괄적으로 삭제하는 방법이 없을까요..
2 응답 2
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 06-11-2005 10:00 PM
날짜: 06-11-2005 10:00 PM
패턴방식으로 파일 삭제하는 방법...
ls -al | grep May | awk '{print "rm",$NF}' | sh -x
로 해 보세요.
원하시는 부분만 삭제가 되실 겁니다.
마지막 부분 | sh -x 부분을 빼고 실행을 시키시면
실행 되어질 Command가 화면으로 보입니다.
확인을 해 보시고 싶으시면 | sh -x 부분을 > file명
으로 Redirection 받아서 확인을 해 보신후에 실행을
하셔도 됩니다. 저도 자주 사용하는 명령어라 크게
문제가 되시지는 않을 것 같습니다.
그럼 좋은 하루 되세요.
로 해 보세요.
원하시는 부분만 삭제가 되실 겁니다.
마지막 부분 | sh -x 부분을 빼고 실행을 시키시면
실행 되어질 Command가 화면으로 보입니다.
확인을 해 보시고 싶으시면 | sh -x 부분을 > file명
으로 Redirection 받아서 확인을 해 보신후에 실행을
하셔도 됩니다. 저도 자주 사용하는 명령어라 크게
문제가 되시지는 않을 것 같습니다.
그럼 좋은 하루 되세요.
위에 명시된 의견은 Hewlett Packard Enterprise가 아닌 저자의 개인 의견입니다. 이 사이트를 사용하면 이용 약관에 동의하게되며 참여 규칙 .
뉴스 및 이벤트
© Copyright 2024 Hewlett Packard Enterprise Development LP