find / -nouser -o -nogroup -print
/etc/cups
/etc/cups/snmp.conf
/etc/cups/pdftops.conf
...중략



신고

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 / -type f \( -perm -004000 -o -perm -002000 \) -exec ls -lg {} \;


신고

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 / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;

많은 파일들이 보임.


신고

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
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

# find /home/jjangkbg -type f -mtime +60 | xargs tar -cvf /tmp/`date '+%d%m%Y'_archive.tar`
tar: Removing leading `/' from member names

/home/jjangkbg/hydra/list.php
/home/jjangkbg/hydra/hydra-6.5-src.tar.gz
/home/jjangkbg/hydra/hydra-6.5-src/hydra-cvs.o

...중략

[root@www jjangkbg]# ll /tmp/
total 11844
-rw-r--r-- 1 root root 12103680 Nov 15 14:26 15112012_archive.tar

 

 

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

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


/home/test


cat test.txt 
guk


find /home/test/ -type f -exec egrep -i "guk" /dev/null {} \;
/home/test/test.txt:guk

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

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 / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;


find 옵션중.

-perm mode
File's permission bits are exactly mode (octal or symbolic). Since an exact match is
required, if you want to use this form for symbolic modes, you may have to specify a rather
complex mode string. For example '-perm g=w' will only match files which have mode 0020
(that is, ones for which group write permission is the only permission set). It is more
likely that you will want to use the '/' or '-' forms, for example '-perm -g=w', which
matches any file with group write permission. See the EXAMPLES section for some illustra-
tive examples.

 

ls 옵션중

       -l     use a long listing format

       -g     like -l, but do not list owner

 

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

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