Skip to main content

Command

  • total count 방법

       find ./Pictures -name '*.bmp' | wc -l | xargs printf "\nTotal Count = \"%s\" files \n\n"
  • 하위 폴더 모두 EUC-8에서 UTF-8로 변경

       find ./ -name '*.txt' -exec iconv -c -f euc-kr -t utf-8 {} -o {}-u.txt  \;
  • nmon root로 실행

    nmon -f -d -t -s 60 -c 240 
  • 20일 전 파일 삭제

    find /app/ldsp/backup -mtime +20 -print | xargs rm -f   <-- 폴더까지는 -rf로 처리 주의 필요 !
  • 3004-303 There have been too many unsuccessful login attempts;

    chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -swebtob
    chuser account_locked=false webtob
    passwd webtob
    pwdadm -f NOCHECK webtob
  • 폴더 삭제 10일이전 모든 디렉토리

    0 2 * * * find /swlog/batch/log -mtime +10 -type d -name '20*' -print | xargs rm -rf
  • 파일 삭제 10일이전 모든 디렉토리

    0 2 * * * find /swlog/webtob -name 'system*' -mtime +15 -print | xargs rm -f
  • 파일명 rename 변경

    for x in `du -a | cut -d '/' -f2- | grep JPG`; do mv "$x" "${x%.JPG}.jpg"; done
  • 폴더별 사이즈 조사

    find ./ -name '*Job' -type d -print | xargs du -sg
  • 사이즈 조사

    du --max-depth=1 --human-readable
  • CPU 코어 전체

            grep -c processor /proc/cpuinfo
  • 물리 CPU

           grep "physical id" /proc/cpuinfo | sort -u | wc -l
  • CPU당 물리 코어

       grep 'cpu cores' /proc/cpuinfo | tail -1
  • 하이퍼쓰레딩

        cat /proc/cpuinfo | egrep 'siblings|cpu cores' | head -2