linux command

yknam·2020년 5월 15일
0

log size조정(Limit the size of logrotate)

#설정보기
sudo nano /etc/logrotate.d/rsyslog

#size 100k 추가
/var/log/syslog
{
    rotate 7
    size 100k
    daily
    missingok
    notifempty
    delaycompress
    compress
    postrotate
        /usr/lib/rsyslog/rsyslog-rotate
    endscript
}
#재시동
sudo service rsyslog restart

현재 디렉토리에서 IMCMaster를 포함한 글 찾기
find . -type f -exec grep -l "IMCMaster" {} \;

찾아서 바꾸기

* find word1 and replace with word2 using sed 
sed -i 's/word1/word2/g' input
* you can change the delimiter to keep syntax simple 
sed -i 's+word1+word2+g' input
sed -i 's_word1_word2_g' input
* you can add I option to GNU sed to case insensitive search 
sed -i 's/word1/word2/gI' input
sed -i 's_word1_word2_gI' input

ssh alias 설정

Host nam
    User yknam
    HostName imcmaster.iptime.org
    Port 7070

public key

  1. Run ssh-keygen
  2. Copy to remote ssh-copy-id username@ip

scp download

scp -r yknam@192.168.0.31:/home/yknam/imcfiles/volbackup ./imcfiles
(scp -r remotesvr:remotedir currentdir)

profile
50대 개발자 노드, 자바스크립트

0개의 댓글