{"id":178,"date":"2024-09-05T05:14:12","date_gmt":"2024-09-05T05:14:12","guid":{"rendered":"https:\/\/www.mhtechin.com\/support\/?p=178"},"modified":"2024-09-05T05:14:12","modified_gmt":"2024-09-05T05:14:12","slug":"basic-linux-commands-for-aws-and-devops-a-guide-for-the-mhtechin-software-development-team","status":"publish","type":"post","link":"https:\/\/www.mhtechin.com\/support\/basic-linux-commands-for-aws-and-devops-a-guide-for-the-mhtechin-software-development-team\/","title":{"rendered":"Basic Linux Commands for AWS and DevOps: A Guide for the MHTECHIN Software Development Team"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Introduction:<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In the world of <strong>AWS and DevOps<\/strong>, Linux commands play a crucial role in managing infrastructure, automating processes, and troubleshooting. For any professional working in cloud environments, especially on AWS, having a solid understanding of basic Linux commands is essential. In this article, I will cover some fundamental Linux commands used frequently by the <strong>Mhtechin software development team<\/strong> when managing AWS resources and implementing DevOps practices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Navigating Directories<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When working with AWS EC2 instances or any Linux-based servers, navigating directories is a common task.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>pwd<\/code>: Prints the current working directory. <code>pwd<\/code><\/li>\n\n\n\n<li><code>ls<\/code>: Lists files and directories in the current directory. <code>ls<\/code><\/li>\n\n\n\n<li><code>cd<\/code>: Changes the directory.<br><code>bash cd \/path\/to\/directory<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>File Operations<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Managing files is a critical part of Linux, especially in the context of deploying applications, configuring services, and logging.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>touch<\/code>: Creates an empty file. <code>touch filename.txt<\/code><\/li>\n\n\n\n<li><code>cat<\/code>: Displays the contents of a file. <code>cat filename.txt<\/code><\/li>\n\n\n\n<li><code>cp<\/code>: Copies a file from one location to another. <code>cp source.txt \/destination\/path\/<\/code><\/li>\n\n\n\n<li><code>mv<\/code>: Moves a file or renames it. <code>mv oldname.txt newname.txt<\/code><\/li>\n\n\n\n<li><code>rm<\/code>: Deletes a file.<br><code>bash rm filename.txt<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Managing Permissions<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Permissions are important when deploying and managing applications on AWS instances or containers.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>chmod<\/code>: Changes the permissions of a file or directory. <code>chmod 755 filename.sh<\/code><\/li>\n\n\n\n<li><code>chown<\/code>: Changes the owner of a file or directory.<br><code>bash chown user:group filename.txt<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Network Operations<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Network management is essential in a cloud environment. Checking connectivity between instances and troubleshooting are common DevOps tasks.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ping<\/code>: Checks network connectivity between two machines. <code>ping google.com<\/code><\/li>\n\n\n\n<li><code>curl<\/code>: Transfers data from or to a server. It is widely used to check API responses or download files. <code>curl http:\/\/example.com<\/code><\/li>\n\n\n\n<li><code>wget<\/code>: Downloads files from the web.<br><code>bash wget http:\/\/example.com\/file.zip<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Process Management<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Managing processes is key in deploying applications and running services on Linux.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ps<\/code>: Displays currently running processes. <code>ps aux<\/code><\/li>\n\n\n\n<li><code>top<\/code>: Provides a real-time view of running processes, memory, and CPU usage. <code>top<\/code><\/li>\n\n\n\n<li><code>kill<\/code>: Terminates a running process.<br><code>bash kill -9 process_id<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>Package Management<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Installing and managing software packages is a daily task for Linux system admins and DevOps engineers.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>apt-get<\/code>: Package manager for Ubuntu\/Debian-based systems (used to install, update, and remove software). <code>sudo apt-get update sudo apt-get install package_name<\/code><\/li>\n\n\n\n<li><code>yum<\/code>: Package manager for Red Hat-based systems.<br><code>bash sudo yum update sudo yum install package_name<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>Disk Space Management<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Disk space management is important when handling data storage and backups.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>df<\/code>: Displays disk space usage. <code>df -h<\/code><\/li>\n\n\n\n<li><code>du<\/code>: Shows disk usage of files and directories.<br><code>bash du -sh \/path\/to\/directory\/<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">8. <strong>SSH to EC2 Instance<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">One of the most common Linux tasks in AWS environments is accessing EC2 instances using SSH.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ssh<\/code>: Securely connects to a remote Linux server or EC2 instance.<br><code>bash ssh -i keyfile.pem ec2-user@ec2-public-ip<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">9. <strong>System Updates<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Keeping your Linux system updated is essential for security and stability.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For Ubuntu\/Debian: <code>sudo apt-get update &amp;&amp; sudo apt-get upgrade<\/code><\/li>\n\n\n\n<li>For CentOS\/Red Hat:<br><code>bash sudo yum update<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">10. <strong>Logs and Monitoring<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Monitoring logs is important to troubleshoot any issues during application deployment and for AWS services.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>tail<\/code>: Displays the last lines of a file, useful for checking logs. <code>tail -f \/var\/log\/syslog<\/code><\/li>\n\n\n\n<li><code>grep<\/code>: Searches for a specific string within files. Often used to find errors or events in logs.<br><code>bash grep \"error\" \/var\/log\/syslog<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Linux commands are the building blocks for managing cloud infrastructure and implementing DevOps practices. Whether you&#8217;re working with AWS EC2 instances, containers, or orchestrating CI\/CD pipelines, mastering these basic commands will enhance your efficiency and troubleshooting skills. The <strong>Mhtechin software development team<\/strong> frequently relies on these commands in their day-to-day DevOps activities, making them essential for anyone working in the field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These fundamental commands form the backbone of daily operations, and mastering them is key to success in both AWS and DevOps environments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: In the world of AWS and DevOps, Linux commands play a crucial role in managing infrastructure, automating processes, and troubleshooting. For any professional working in cloud environments, especially on AWS, having a solid understanding of basic Linux commands is essential. In this article, I will cover some fundamental Linux commands used frequently by the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-support"],"_links":{"self":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":1,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/posts\/178\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mhtechin.com\/support\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}