From f97b816624077b2f1a5658b3af5c97dfbd4f57b2 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Tue, 9 Nov 2021 10:19:05 +1100 Subject: [PATCH] update --- categories/devops/linux.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/categories/devops/linux.md b/categories/devops/linux.md index eb2a4cd..114ec4c 100644 --- a/categories/devops/linux.md +++ b/categories/devops/linux.md @@ -2,6 +2,14 @@ ## Useful commands and tips +### Split strings + +```bash +# split ip list string by comma and get first one +export IP=127.0.0.2,127.0.0.3 +echo $IP | cut -d ',' -f1 +``` + ### Create a systemd service Create a file called `/etc/systemd/system/hello.service`