csh 환경에서 stderr redirection
xargs grep 을 통해 특정 키워드 탐색 시 stderr redirection을 하지 않으면 디렉토리 관련 오류 메시지를 현시한다.
이런 경우 stderr 메시지를 /dev/null 경로로 redirection 하여 키워드가 포함된 결과만 확인할 수 있다.
e.g.) 현재 경로 하위에서 내용 중 lib-release 라는 키워드를 찾고 싶을 때 사용
csh 환경
(find . | xargs grep "lib-release" > /dev/tty) >& /dev/null
bash 활용
bash -c 'find . | xargs grep "lib-release" 2> /dev/null'
'IT > linux' 카테고리의 다른 글
ctags 옵션 / recursive, only c, c++, exclude (0) | 2022.09.04 |
---|---|
RHEL HOME/END key bind (0) | 2022.09.04 |
linux NTP Server / Client 설치 및 설정 정보 (0) | 2022.01.20 |
mplayer slave mode, 파이프, 커맨드 사용 (0) | 2022.01.20 |
리눅스 특정 프로세스 전부 종료시키기 / ps, grep, awk, xargs, kill (0) | 2022.01.19 |
댓글