# Shell learning *system service* ###### tags: `shell` Copyright 2021, [月下麒麟 YMont](https://hackmd.io/@YMont/note-catalog) --- ## outline 學習shell腳本與linux指令認識 ## command ```which python3```  ```which python3 | sed 's/\//\\\//g'```  產生反斜線(backslash) ```cat main.py | sed "s/python/java/g" > `pwd`/main```  main(.py)  main(no file extension) ``` cat `pwd`/main```(補充)  ```ln -sf /test.service /etc/systemd/system/```  建立軟連結至系統配置處(administrate)  於/etc/systemd/system就會看到該main.service被連結在此 ```sudo systemctl enable main``` 即可針對該service執行啟用 systemctl 的 start 與 stop 兩個操作指令是用來控制目前服務的狀態 如果想要設定開機自動啟動服務的話,就要改用 enable 與 disable Reference:[Linux 指令 SED 用法教學、取代範例、詳解](https://terryl.in/zh/linux-sed-command/) Reference:[Linux systemd 系統服務管理基礎教學與範例](https://blog.gtwang.org/linux/linux-basic-systemctl-systemd-service-unit-tutorial-examples/)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up