Command Line Conquest: The Ultimate Cheat Sheet with Linux, Git, and GitHub Commands

Chinay BoharaChinay Bohara
6 min read

๐Ÿš€ Introduction

Welcome to my learning journey where I share my discoveries on mastering the command line with a focus on Linux, Git, and GitHub commands. In this blog, we'll delve into essential commands for efficient operations. Whether you're an aspiring DevOps engineer or just looking to boost your command line skills, this cheat sheet has got you covered.

๐Ÿ’ป Linux Commands with Description & Usage

  1. ls: List all the directories and files.

  2. mkdir: Makes a new directory.

  3. rmdir: Remove a directory (only if it's empty).

  4. cd: Change directory.

  5. cd ..: Go back to the previous directory.

  6. pwd: Print the current working directory.

  7. ls -l: List files with more details.

  8. cat: Show the content of a file.

  9. echo: Shows the desired string and value.

  10. man: Tells about all commands.

  11. touch: Create a file.

  12. cp: Copy files.

  13. mv: Move files.

  14. rm: Remove the file permanently.

  15. sudo: Administrative commands (password).

  16. head: Display the first 10 lines.

  17. tail: Display the last 10 lines.

  18. zip: Zip files in Linux.

  19. unzip: Unzip files in Linux.

  20. ssh: Secure Shell command in Linux.

  21. service: Linux command to start and stop services.

  22. ps: Display active processes.

  23. wget: Download files from the internet.

  24. whoami: Show the current user.

  25. grep: Search for a string within an output.

  26. sort: Sort the file content.

  27. cal: View Calendar in the terminal.

  28. whereis: View the exact location of any command types after this command.

  29. kill and killall: Kill active processes by process ID or name.

  30. chmod: Change file permissions.

  31. chown: Change file ownership.

  32. history: Shows history of command usage.

  33. useradd and usermod: Add a new user or change the existing user's data.

  34. passwd: Create or update passwords for existing users.

  35. df: Display disk space usage of file systems.

  36. du: Estimate file and directory space usage.

  37. tar: Archive files and directories into a single file.

  38. find: Search for files and directories.

  39. grep: Search for a pattern in files.

  40. chmod: Change file permissions.

  41. chown: Change file ownership.

  42. ln: Create links between files.

  43. uptime: Show system uptime and load averages.

  44. top: Display system processes and resource usage.

  45. free: Display memory usage statistics.

  46. ifconfig: Display or configure network interfaces.

  47. netstat: Display network statistics.

  48. ssh-keygen: Generate SSH key pairs.

  49. scp: Securely copy files between hosts.

  50. rsync: Synchronize files and directories between two locations.

  51. cron: Schedule tasks to run at specific intervals.

  52. crontab: Manage user-specific cron jobs.

  53. history: View and manage command history.

  54. sed: Stream editor for text manipulation.

  55. awk: Text processing and pattern matching.

  56. nano or vi: Text editors for file editing.

  57. ping: Send network ICMP echo requests to a host.

  58. traceroute: Trace the route packets take to a destination.

  59. shutdown: Shutdown or reboot the system.

  60. kill: Terminate processes by ID or name.

๐Ÿ™ Git-GitHub Commands with Description & Usage

  1. git init: Initialize a new Git repository in the current directory.

  2. git clone <repository-url>: Clone a remote repository to your local machine.

  3. git status: Show the current status of the repository.

  4. git add <file>: Add a file to the staging area.

  5. git commit -m "commit message": Create a new commit with a message.

  6. git diff: View the differences between the working directory and the staging area.

  7. git log: Display the commit history.

  8. git branch: List all branches in the repository.

  9. git checkout <branch>: Switch to a different branch.

  10. git merge <branch>: Merge changes from a branch into the current branch.

  11. git pull: Fetch and merge changes from a remote repository.

  12. git push: Push local commits to a remote repository.

  13. git remote add origin <repository-url>: Add a remote repository as the origin.

  14. git remote -v: View a list of remote repositories and their URLs.

  15. git reset <file>: Unstage changes for a file.

  16. git rm <file>: Remove a file from the repository and staging area.

  17. git stash: Temporarily store changes not ready for a commit.

  18. git cherry-pick <commit>: Apply changes from a specific commit.

  19. git fetch: Download objects and refs from another repository.

  20. git revert <commit>: Create a new commit that undoes changes from a specific commit.

  21. git push origin <branch>: Push local commits to a remote branch on GitHub.

  22. git pull origin <branch>: Fetch and merge changes from a remote branch on GitHub.

  23. git fork: Create a copy of a repository on your GitHub account.

  24. git pull-request: Create a pull request to propose changes from your fork.

  25. git pull upstream <branch>: Pull changes from the original repository after forking (upstream).

  26. git remote add upstream <original-repo-url>: Add the original repository as the upstream remote for your fork.

  27. git branch -d <branch>: Delete a local branch after it's merged and no longer needed.

  28. git push origin --delete <branch>: Delete a remote branch on GitHub.

  29. git stash pop: Apply and remove the most recently stashed changes.

  30. git stash list: List all stashed changes.

  31. git stash apply: Apply the changes from a specific stash.

  32. git stash drop: Delete a specific stash.

  33. git stash clear: Remove all stashes.

  34. git remote show <remote>: Show detailed information about a remote.

  35. git tag: Create, list, or delete tags.

  36. git blame <file>: Show who changed each line in a file.

  37. git config: Set or get repository or global configuration options.

  38. git log --graph: Display the commit history in a graph view.

  39. git reflog: Show a log of changes to branch references.

  40. git rebase: Reapply commits on top of another base tip.

  41. git reset --hard <commit>: Reset the repository to a specific commit.

  42. git clean: Remove untracked files and directories.

  43. git bisect: Find the commit that introduced a bug using binary search.

  44. git show: Show the details and changes of a commit.

  45. git grep: Search for a pattern in tracked files.

  46. git remote set-url <remote> <url>: Update the URL of a remote repository.

  47. git submodule: Manage submodules within a repository.

  48. git rebase -i: Interactively rebase commits.

  49. git cherry-pick --continue / --abort: Continue or abort a cherry-pick sequence.

  50. git commit --amend: Modify the most recent commit.

๐ŸŽ‰ Conclusion

In wrapping up, we've created a cheat sheet packed with Linux, Git, and GitHub commands to empower individuals across all levels of expertise, from beginners to seasoned IT professionals. These commands are the fundamental tools you need for efficient and productive command-line operations, whether it's file management, network tasks, or version control.

By keeping this cheat sheet close at hand, you're not just simplifying your workflow; you're also enhancing your troubleshooting capabilities and leveling up your proficiency in the command line. ๐Ÿš€๐Ÿ’ป

"Thank you for investing your time in reading this blog. I trust you discovered the content to be informative and enlightening. To stay up-to-date with my latest insights and articles on DevOps ๐Ÿš€, I invite you to follow me at:

Hashnode: https://chinayb.hashnode.dev/

LinkedIn: www.linkedin.com/in/chinaybohara

See you in the next blog post, fellow learners! ๐Ÿš€

Keep Learning, Keep Growing, Keep Sharing

0
Subscribe to my newsletter

Read articles from Chinay Bohara directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chinay Bohara
Chinay Bohara

๐Ÿš€ DevOps Enthusiast & Tech Blogger ๐Ÿ› ๏ธ | Undergraduate on a journey to master the art of DevOps. Sharing insights, learning adventures, and embracing the tech evolution. Join me in exploring the world of seamless software delivery and automation! โœจ"