[linux] 스크립트에서 ls 등 명령어 실행하는 법
쉘 스크립트란? https://daewoonginfo.blogspot.com/2019/04/linux.html
쉘 스크립트에서 명령어 실행하는 법
쉘 스크립트 생성
$ vi run_init.sh
#!/bin/bash
ls
현재 디렉토리에 있는 내용을 출력하게 만들었습니다.#!/bin/bash
ls
실행 권한 부여
$ chmod +x run_init
run_init.sh을 실행시키기 위해 실행권한(execute)을 부여했습니다.chmod가 익숙하지 않으신 분은 아래의 링크를 참조하세요.
chmod - https://daewoonginfo.blogspot.com/2019/06/linux-chmod.html
쉘 스크립트 실행
$ ./run_init.sh
댓글
댓글 쓰기