Useful shell commands

In this tutorial, I will write about Useful shell commands. Tips and trick about kill process, How to remove ssh host and SCP command. Bash script the essential for DevOps Roles.

Useful shell commands

Kill Process

ps aux | grep <keyword> | grep -v grep | awk '{ print "kill -9", $2 }' | sh

For example, How to kill running Tilix process as the picture below

Useful shell commands

Kill the process Tilix

[huupv@huupv devopsroles]$ ps aux | grep tilix | grep -v grep | awk '{ print "kill -9", $2 }' | sh

How to remove ssh host

ssh-keygen -R <IP address/host_name>

SCP command

Upload to server

scp -i <ssh key private file> -r <local directory/file> <user>@<remote server>:<remote directory/file>

Download from server

scp -i <ssh key private file> -r <user>@<remote server>:<remote directory/file> <local directory/file>

Conclusion

Thought the article, How to use “Useful shell commands” as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.