3. OS이야기 98

HP hostname 변경하기

1. 첫번째 방법 1) vi /etc/hosts 파일에서 이름변경. 2) vi /etc/rc.config.d/netconf 파일에서 호스트네임변경후에 3) /sbin/init.d/hostname start 4) /sbin/init.d/net start 시킨후에 .profile 재실행 또는 logout 후 login 하면 됩니다. 2. 두번째 방법 1) set_parms 명령어 수행후 호스트 네임 변경해야됨니다. 3. 세번째 방법 1,/etc/hosts 파일 IP,hostname 변경 [soong-ju:/etc] vi hosts (IP, hostname 변경) [soong-ju:/etc/rc.config.d]vi netconf (IP, hostname 변경) [soong-ju:/etc/rc.config.d..

3. OS이야기 2010.06.04

Unix 계열에서 디렉토리네 모든 파일에서 특정문자 치환

현재 디레토리 하부구조에서 특정 문자열을 포함하고 있는 모든 파일 목록 찾기 find . -type f | xargs grep -l web_test > /tmp/t.txt 목록파일을 읽어들여 목록에 나열된 각 파일에서 특정 문자열을 새로운 문자열로 치환하는 명령어 sh rep.sh /tmp/t.txt web_test testibm01 나열된 파일에서 web_test를 testibm01로 변경 rep.sh 내용 #!/bin/sh if [ $# != 3 ];then echo "Uages: /tmp/rep.sh " exit; fi set -x mkdir -p /tmp/tt for file in `cat $1` do echo "" echo $file cat $file | sed -e "s/$2/$3/g" > /..

3. OS이야기 2010.03.24

Unix 계열에서 디렉토리명 일괄 변경하기

현재디렉토리에서 하부디렉토리 이름 중, 특정 문자열을 포함한 디렉토리 찾기 find . -type d | grep web_test 아래의 redir.sh 파일을 만든후 아래와 같이 redir.sh old_dir new_dir 하시면 됩니다. repdir.sh 내용 #!/bin/sh if [ $# != 2 ];then echo "Uages: /tmp/repdir.sh " exit; fi set -x for dump in `find . -name $1 -type d` do for dir in `find . -name $1 -type d` do target=`echo $dir| sed "s/$1/$2/g"` mv $dir $target break done done set +x

3. OS이야기 2010.03.24

lsof 툴 다운로드

사이트 지원할 때 파일 디스크립터(File Descriptor)를 종종 확인해야 할 경우가 있습니다. 이럴 때 사용할 수 있는 툴로는 pfiles나 lsof가 대표적입니다. 아래 사이트에서 lsof 바이너리를 각 플랫폼별로 다운 받을 수 있습니다. http://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ 사용법은 간단하게 lsof만 수행하시면 시스템 전체의 file descriptor사용내역을 보여주고 lsof -p [PID] 를 하면 해당 PID에 대한 file descriptor를 보여줍니다.

3. OS이야기 2009.09.29