Day 12 : Task Completed on Linux & Git-GitHub

Day 12 : Task Completed on Linux & Git-GitHub

Empowering Your Command Line and Version Control Skills: Essential Cheat Sheets for Linux and Git Commands

🔶 Cheat sheet on Linux.

  1. pwd - To check the print working directory. It prints the path of the working directory, starting from the root.

  2. ls - To list directories.

  3. ls -a - To list all files and directories, including hidden files.

  4. mkdir - To make a new directory.

  5. rmdir - To remove a directory/ Folder.

  6. vim - To create a fruits.txt file and to view the content.

  7. cat - To view what's written in a file.

  8. head -3 file_name - To Show only the top three fruits from the file.

  9. tail -3 file_name - To Show only the bottom three fruits from the file.

  10. diff f1 f2 - To find the difference between f1 and f2 files.

  11. chmod - To change the access permissions of files.

  12. chown - The owner of the file or application.

  13. chgrp - The group that owns the file or application.

  14. history - To check which commands you have run till now.

  15. Cron - Cron is generally used for running scheduled backups, monitoring disk space, deleting files periodically which are no longer required, running system maintenance tasks and a lot more.

  16. CronTab - We can define multiple jobs, for their scheduled time and the account under which the job should run.

  17. crontab -e - To select an editor and open corntabEdits a copy of the user's crontab file.

  18. crontab -l \ - Lists the user's crontab file.

  19. crontab -r - Removes the user's crontab file from the crontab directory.

  20. ls -ltr - To see the details of the files.

    File permissions:

  21. Read (r) - Allows reading or viewing the content of the file. For directories, it allows listing the contents of the directory.

  22. Write (w) - Permits modifying the file's content or deleting the file. For directories, it allows adding, removing, or renaming files within the directory.

  23. Execute (x) - Enables executing the file if it is a script or a binary executable file. For directories, it allows accessing the contents of the directory.

  24. ACLs - (Access Control Lists) are represented using an extended syntax that includes additional access permissions and qualifiers, such as read-data, write-data, execute, delete, and more.

  25. getfacl - a command displays ACL information.

  26. setfacl - a command that allows you to modify ACLs.

  27. systemctl - is a command-line tool used to control the systemd system and service manager, which is the default initialization system in most modern Linux distributions. It allows users to start, stop, restart, enable, disable, and manage system services, targets (similar to runlevels), and other units managed by systemd.

  28. service - is a legacy command used to control system services in older Linux distributions that do not use systemd as their default initialization system. It is also used in some current distributions for compatibility purposes. While it can perform similar actions to systemctl, its syntax and capabilities are more limited.

🔶 Cheat sheet on Git-GitHub.

  1. sudo apt install git: To install it with Ubuntu.

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

  3. git --version: To confirm that you have installed Git.

  4. git clone <repository-url>: To clone the remote repo to the local repo.

  5. git status: To check the current status of the repo.

  6. git add <file_name>: To add a file to the staging area to be included in the next commit.

  7. git commit -m <Commit Message>: Make a commit by taking the updated working tree contents of the paths specified on the command line.

  8. git push -u origin main: To push the local commits to a remote repository.

  9. git revert <commit-id>: To remove or edit changes you’ve made in the code in previous commits.

  10. git rebase <branch name>: To remove or edit changes you’ve made in the code in previous commits.

  11. git merge: Git merge is a command that allows developers to merge Git branches while the logs of commits on branches remain intact.

  12. git stash: Use git stash to save the changes without committing them.

  13. git log --oneline: To print a single commit in a single line as output when the git log command is executed using this option.

  14. git checkout <branch_name>: Command lets you navigate between the branches created by git branch.

  15. git cherry-pick <commit_id>: To apply changes from a specific commit to the current branch.

  16. git push origin --delete <branch>: To fully delete a remote branch on GitHub.

🔶 Conclusion:

In conclusion, a comprehensive Linux command and Git commands cheat sheet can be an invaluable resource for both beginners and experienced users. Mastering the essential Linux commands empowers users to navigate the Linux environment efficiently, perform file and directory operations, manage processes, and interact with the system effectively. Understanding Git commands is crucial for version control, enabling developers to collaborate, track changes, create branches, merge code, and manage repositories seamlessly.

Stay in the loop with my latest insights and articles on cloud ☁️ and DevOps ♾️ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge

Did you find this article valuable?

Support Chandresh Patle's Blog by becoming a sponsor. Any amount is appreciated!