Day 14: Create a Linux & Git-GitHub Cheat Sheet
"Passionate about simplifying the complexities of DevOps, I bring 5 years of hands-on experience in supporting development and operations teams to achieve faster, more reliable software delivery. I thrive on optimizing CI/CD pipelines, automating workflows, and troubleshooting challenges across diverse cloud environments. My expertise spans across infrastructure management, continuous integration, and performance monitoring—ensuring stability and efficiency at every stage of the software lifecycle. Always eager to learn, collaborate, and innovate, I’m committed to driving impactful change in the DevOps space."
Key Uses of Linux:
Server Management:
- Linux is extensively used to run servers due to its stability, security, and flexibility. Many web servers, database servers, and cloud systems rely on Linux.
Software Development:
- Programmers and developers prefer Linux for its versatility and compatibility with various programming languages and tools. It also allows customization, automation with shell scripting, and has strong support for development environments.
Networking and Security:
- Linux provides strong networking capabilities, making it popular among network administrators. Many cybersecurity professionals also use Linux for its access to various security tools and configurations.
Embedded Systems and IoT:
- Due to its efficiency and low resource requirements, Linux is common in embedded systems and IoT devices, like smart thermostats, automotive infotainment systems, and industrial control systems.
Education and Research:
- Linux is often used in research and academia, where high-performance computing, data science, and simulations require a flexible, open platform.
Personal Use:
- Many users choose Linux for personal computing because it is open-source, meaning it’s free, and is highly customizable, allowing users to tailor it to their needs.
Advantages of Linux:
Security: Linux is generally more secure than many other operating systems due to its user permissions and open-source nature.
Stability and Performance: Linux systems are known for running efficiently for long periods without crashing.
Open Source and Free: Being open source, Linux can be modified, and it’s typically free, saving costs.
Customization: Users can modify Linux to fit their specific needs, from the desktop environment to the kernel itself.
Community Support: Linux has a large community that supports development, troubleshooting, and innovation.
Install a package:
sudo apt install <package-name>Remove a package:
sudo apt remove <package-name>Install nginx:
sudo apt install nginxCheck nginx version:
nginx -v
File and Directory Management
List files in a directory:
lsList files with detailed information:
ls -lhChange directory:
cd <directory-name>Create a new directory:
mkdir <directory-name>Remove an empty directory:
rmdir <directory-name>Remove a file:
rm <file-name>Create an empty file:
touch <file-name>Show current directory:
pwd
User Management
Add a new user:
sudo adduser <username>Change file owner:
sudo chown <new-owner> <file-name>Change file group:
sudo chgrp <new-group> <file-name>
Permissions
- Change file permissions:
sudo chmod <permissions> <file-name>
Process Management
View running processes:
psView Docker processes:
docker ps
Docker Commands
Pull a Docker image:
docker pull <image-name>Run a Docker container:
docker run <image-name>List Docker images:
docker images
Networking
Check system status:
sudo systemctl status <service-name>Start a service:
sudo systemctl start <service-name>Enable a service to start at boot:
sudo systemctl enable <service-name>
Miscellaneous
Clear the terminal screen:
clearOpen a file in a text editor:
vim <file-name>
Scheduling Tasks
Edit crontab:
crontab -eList crontab entries:
crontab -l
Backup and Archive
Create a zip archive:
zip <archive-name>.zip <file1> <file2>List zip contents:
unzip -l <archive-name>.zip
Version Checking
- Check Java version:
java -version
Jenkins Installation and Setup
Install Jenkins
sudo apt update
sudo apt install jenkinsClean Up Package Cache
sudo apt cleanStart and Enable Jenkins Service
sudo systemctl start jenkins
sudo systemctl enable jenkinsCheck Jenkins Service Status
sudo systemctl status jenkinsView Jenkins Log
sudo cat /var/log/jenkins/jenkins.logView Detailed Jenkins Log
sudo journalctl -xe -u jenkinsRestart Jenkins Service
sudo systemctl restart jenkinsStop Jenkins Service
sudo systemctl stop jenkins
Docker Commands
Enable Docker to Start on Boot
systemctl enable dockerCheck Docker Service Status
systemctl status dockerView Docker Logs
journalctl -u docker
Git Configuration and Repository Setup
Configure Git Username and Email
git config --globaluser.name"Vani019"
git config --globaluser.email"shivani019singh@gmail.com"View Git Configuration
git config --listInitialize Git Repository
mkdir github
cd github
git initSet Default Branch Name
git config --global init.defaultBranch mainAdd Remote Repository
git remote add originhttps://github.com/Vani019/Test.gitCreate Subdirectories and Add a File
mkdir -p Devops/Git
echo "Created new directory" > Devops/Git/GitTest1.txtAdd and Commit Changes
git add .
git commit -m "Initial commit with .txt file"Push to Remote Repository
git push -u origin mainSwitch to a New Branch
git checkout -b mainCheck Git Status
git status
In summary, this cheat sheet provides a quick reference for essential commands to install, configure, and manage Jenkins, Docker, and Git. The Jenkins section covers steps to install, start, enable, and check the status of the Jenkins service, as well as viewing and managing logs. Docker commands include enabling Docker to start on boot, checking its status, and viewing logs, which helps ensure your Docker environment runs smoothly. The Git section details key setup commands such as configuring user information, initializing repositories, setting branch names, and managing commits and branches, which is crucial for efficient version control.
With these commands, you can set up and maintain continuous integration with Jenkins, containerization with Docker, and streamlined version control with Git—providing a solid foundation for DevOps and collaborative software development.



