Day 14 of My 90-Day DevOps Challenge: Linux Commands Cheat Sheet πŸ§πŸ“„


🌟 Linux Cheat Sheet 🌟

Linux is the backbone of most cloud and DevOps environments. Mastering basic and advanced Linux commands is essential for system administration, scripting, and automation. Below is your go-to cheat sheet with all the Linux commands from basic to advanced.

1. File and Directory Management

  • ls: Lists files and directories. πŸ“‚

  • cd [directory]: Changes to the specified directory. πŸ“

  • mkdir [directory]: Creates a new directory. πŸ—‚οΈ

  • rm [file]: Removes a file. πŸ—‘οΈ

  • rm -r [directory]: Removes a directory and its contents. 🧹

  • touch [file]: Creates a new, empty file. πŸ“„

  • cp [source] [destination]: Copies files or directories. πŸ“‹

  • mv [source] [destination]: Moves or renames files or directories. πŸ”„


2. Permissions and Ownership πŸ”’πŸ‘₯

  • chmod [permissions] [file]: Changes file or directory permissions.

  • chown [user]:[group] [file]: Changes the owner and group of a file.

  • ls -l: Lists files with detailed information, including permissions.


3. System Information πŸ–₯οΈπŸ“Š

  • uname -a: Displays system information.

  • top: Shows running processes and system resource usage.

  • df -h: Displays disk space usage in human-readable format.

  • free -h: Shows memory usage.


4. Networking πŸŒπŸ“‘

  • ping [hostname]: Sends ICMP echo requests to test network connectivity.

  • ifconfig: Displays network interface configurations.

  • netstat -tuln: Lists open ports and network services.


Git & GitHub Commands Cheat Sheet πŸ™πŸ“˜

1. Basic Git Commands πŸ› οΈ

  • git init: Initializes a new Git repository.

  • git clone [repository_url]: Clones an existing repository.

  • git status: Shows the status of the working directory and staging area.

  • git add [file]: Adds files to the staging area.

  • git commit -m "[message]": Commits staged changes with a message.

2.Branching & Merging πŸŒΏπŸ”€

  • git branch: Lists all branches.

  • git branch [branch_name]: Creates a new branch.

  • git checkout [branch_name]: Switches to the specified branch.

  • git merge [branch_name]: Merges the specified branch into the current branch.

3. GitHub Collaboration πŸ€πŸ’»

  • git push origin [branch_name]: Pushes local changes to the remote repository.

  • git pull origin [branch_name]: Fetches and merges changes from the remote repository.

  • git fetch: Downloads changes from the remote but doesn't merge them.

4. Tagging & Releases πŸ·οΈπŸš€

  • git tag [tag_name]: Creates a new tag.

  • git push origin [tag_name]: Pushes a tag to the remote repository.

    πŸ“ Conclusion

    Mastering Linux and Git-GitHub commands is fundamental for any DevOps engineer. Whether you’re building pipelines, deploying applications, or collaborating on open-source projects, having these commands at your fingertips will make your workflow smoother and more efficient.

    By using this cheat sheet, you can:

    • Automate system administration tasks using Linux.

    • Manage source code efficiently with Git.

    • Collaborate and deploy code to GitHub with ease.

Happy learning and coding! πŸš€

Β