728x90 LINUX 22 Linux2 OS- 쉘 스크립트 cd 명령어 사용 shell script 상에서 실행 되는 로직은 sub shell에서 동작 한다. 그래서 쉘이 동작중에만 이동한다. 즉 쉘 스크립트 안에서 디렉토리를 이동해서 작업이 하능하다. 하지만 스크립트가 끝나면 스크립트 시작한 디렉토리로 돌아온다. 스크립트가 끝이나고 디렉토리를 이동하려면./script.sh 대신 source script.sh 을 사용하여 스크립트를 실행하면 된다. 2022. 3. 1. Linux2 OS-hostname 변경 [ec2-user@before-host-name] $ hostname before-host-name.internal [ec2-user@before-host-name] $ cat /etc/hostname before-host-name.internal [ec2-user@before-host-name] $ sudo hostnamectl set-hostname new-host-name [ec2-user@before-host-name] $ cat /etc/hostname new-host-name [ec2-user@before-host-name] $ sudo reboot [ec2-user@new-host-name ~] $ Linux2 OS 에서 hostnamectl set-hostname 명령어를 사용해 hostn.. 2022. 2. 15. 이전 1 다음 728x90