[Linux] 스크립트용 커맨드 정리

sed -i 's/기존내용/바꿀내용/' 파일절대경로
ex)
sed -i 's/PASS_MAX_DAYS\t99999/PASS_MAX_DAYS\t10/' /etc/login.defs
\t 는 탭을 의미함
sed -i "라인넘버i 넣을내용" 파일절대경로
ex)
sed -i "5i auth\trequired\tpam_tally.so deny=5" /etc/pam.d/system-auth
sed -i 's/$/문자열/g' 파일절대경로
ex)
sed -i 's/$/pl/g' /etc/group
sshpass -p [Password] ssh -o StrictHostKeyChecking=no root@[IP]
ex)
sshpass -p P@ssw0rd ssh -o StrictHostKeyChecking=no root@10.10.10.5

--

--

gooby goober yeah

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store