root@www ~ [0.00 0.00]> tune2fs -l /dev/xvda1
tune2fs 1.39 (29-May-2006)
Filesystem volume name:   /boot   
Last mounted on:          <not available>
Filesystem UUID:          5eff8143-5abe-432e-b5a4-1624fe82e823
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              26104
Block count:              104388
Reserved block count:     5219
Free blocks:              88221
Free inodes:              26067

First block:              1
Block size:               1024
Fragment size:            1024
Reserved GDT blocks:      256
Blocks per group:         8192
Fragments per group:      8192
Inodes per group:         2008
Inode blocks per group:   251
Filesystem created:       Fri Dec 31 09:55:10 2010
Last mount time:          Thu Jun 14 14:22:59 2012
Last write time:          Thu Jun 14 14:22:59 2012
Mount count:              4
Maximum mount count:      -1
Last checked:             Fri Dec 31 09:55:10 2010
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:            128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      c7d7c2bb-321d-47ba-9735-2de298c3e024
Journal backup:           inode blocks

저작자 표시 비영리 동일 조건 변경 허락
신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

확장자명으로 파일 찾고, 내용까지 출력한다. {} 는 출력값을 하나씩 대입한다는 뜻.

find /home -name '*.txt' -exec cat {} \; -print

find / -name '.forward' -exec cat {} \; -print
/home/test/.forward


신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

#!/bin/sh
Email="xxx@xxx.com";
find /hosting/ -type d -and -name '.*' | grep -v ssh | grep -v .ncftp > /root/hostinghack.txt
find /hosting2/ -type d -and -name '.*' | grep -v ssh | grep -v .ncftp > /root/hosting2hack.txt
(
echo "-----------------------------------------------------------------------------------" && \
echo "오늘 날짜 입니다." &&
date && echo -e "\n"
echo "-----------------------------------------------------------------------------------" && \
echo "-hosting" &&
cat /root/hostinghack.txt && echo -e "\n"
echo "- hosting2" &&
cat /root/hosting2hack.txt && echo -e "\n") \
| mail -s " guk testserver: hack check" ${Email}
echo "done +";
exit 0;



메일온 결과:

-----------------------------------------------------------------------------------
오늘 날짜 입니다.
Tue Nov 27 14:32:45 KST 2012


-----------------------------------------------------------------------------------
-hosting
/hosting/oracle/app/product/11g/uix/cabo/jsLibs/.ade_path
/hosting/oracle/app/product/11g/oc4j/.patch_storage
/hosting/oracle/.oracle


- hosting2
/hosting2/oracle/app/product/11g/uix/cabo/jsLibs/.ade_path
/hosting2/oracle/app/product/11g/oc4j/.patch_storage
/hosting2/oracle/.oracle

신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret
id: cannot find name for user ID



확인 해 본결과 /etc/passwd 600

644 로 변경하니 에러가 나타나지 않는다.
신고

'서버관리' 카테고리의 다른 글

vpn 2 대 동시 연결하여 사용할려면?  (0) 2012.11.27
제목을 입력해 주세요.  (0) 2012.11.27
id: cannot find name for user ID  (0) 2012.11.27
debian4 sources.list  (0) 2012.11.27
debian4 설치  (0) 2012.11.27
데비안 cd image 다운로드  (0) 2012.11.26

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

/root/.bash_profile

export PS1="\u@\h \w> "

\u -> user name
\h -> hostname
\w -> full pathname of current directory

자신이 작업하고 있는 경로가 어디인지 쉽게 알 수 있겠네요.
끝 부분의 공백은 가독성을 높이기 위함입니다.

저작자 표시 비영리 동일 조건 변경 허락
신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret
Argument list too long

해당 디렉토리로 가서 아래 스크립트 실행

for file in $(ls)
do
    rm -fv $file
done


안써먹으니 이 간단한것도 기억에서 잊혀진다.


# find ./ -name "*.log" -print0 
./1.log./2.log

 

# find ./ -name "*.log" -print0 | xargs -0 rm -f
# ls

다 지워 졌음.

 

 

find 옵션

-print0
True; print the full file name on the standard output, followed by a null
character (instead of the newline character that '-print' uses). This
allows file names that contain newlines or other types of white space to be
correctly interpreted by programs that process the find output. This option
corresponds to the '-0' option of xargs.

 

 

xargs 옵션

--null, -0

Input items are terminated by a null character instead of by whitespace, and
the quotes and backslash are not special (every character is taken liter-
ally). Disables the end of file string, which is treated like any other
argument. Useful when input items might contain white space, quote marks,
or backslashes. The GNU find -print0 option produces input suitable for
this mode.

신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret