텍스트 파일 100개가 있습니다.
모든 텍스트 파일을 검색(서브 디렉토리도...)해서,
/root/home 이라고 되어있는 경로를 /root/amtel 로 변경하고 파일을 저장하고 싶습니다.
어떻게 해야 하나요?
$ find . -type f -name \*.txt | xargs -- /usr/bin/perl -w -pi -e 's/\/root\/home/\/root\/amtel/g'
은 어떨까요... ;;
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
혹시 파일 이름이 *.txt *.html *.sql 등 여러가지가 있을 때는 어떻게 해야 하는지도 알려주실 수 있나요? * 나 *.* 같은 것은 안 되더라구요.
find 의 man 페이지에서 OPERATORS 섹션을 보시면 도움이 될겁니다..
$ find . -type f -name \*.txt -o -name \*.html -o name \*.sql ...
하면 되겠네요..
----------------------------------------------- 어머니, 그 이름만으로도 우리는 풍요로와 집니다.
효도합시다...... -----------------------------------------------
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
음...
$ find . -type f -name \*.txt | xargs -- /usr/bin/perl -w -pi -e 's/\/root\/home/\/root\/amtel/g'
은 어떨까요... ;;
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
혹시 파일 이름이
혹시 파일 이름이 *.txt *.html *.sql 등 여러가지가 있을 때는 어떻게 해야 하는지도 알려주실 수 있나요?
* 나 *.* 같은 것은 안 되더라구요.
man find
find 의 man 페이지에서 OPERATORS 섹션을 보시면 도움이 될겁니다..
$ find . -type f -name \*.txt -o -name \*.html -o name \*.sql ...
하면 되겠네요..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
감사합니다... 한번 해볼께요...
-----------------------------------------------
어머니,
그 이름만으로도 우리는 풍요로와 집니다.
효도합시다......
-----------------------------------------------
-----------------------------------------------
어머니,
그 이름만으로도 우리는 풍요로와 집니다.
효도합시다......
-----------------------------------------------
댓글 달기