What do you want to save?
Add Code snippet
New code examples
-
Other 2021-08-27 03:11:01
start a service in bash if stopped
#!/bin/bash SERVICE="nginx" if pgrep -x "$SERVICE" >/dev/null then echo "$SERVICE is running" else echo "$SERVICE stopped" # uncomment to start nginx if stopped # systemctl start nginx # mail ... Add solution -
Shell/Bash 2021-08-26 21:42:01
grep tail
tail -f file | grep --line-buffered my_pattern Add solution -
Shell/Bash 2021-08-26 13:19:01
find process id of port ubuntu
$ sudo netstat -ltnp | grep -w ':80' Add solution -
Shell/Bash 2021-08-26 12:27:02
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
ps aux | grep -i dpkg // Kill processes which are running sudo kill -9 <pid> // Restart the accounts daemon sudo systemctl restart accounts-daemon Add solution -
Shell/Bash 2021-08-26 11:03:02
linux which process is using a port
$ netstat -ltnp | grep -w ':80' Add solution
Best helpers
Ranking is empty