Day 10 of 100 Days: Git and Linux Commands Cheat Sheet
Welcome to your power-packed guide on Git and Linux commands! Think of Git as your digital logbook, capturing every update you make, while Linux is your command-line toolkit, ready to handle everything from organization to quick navigation.
🛠️ Git Commands: Your Code Collaboration Hub
git init
Start a new Git repository in your directory.
Tip: Like opening a blank project binder.
git clone <url>
Duplicate an existing repository locally.
Tip: Making a local copy of shared resources.
git add <file>
Stage changes for the next commit.
Tip: Selecting items for your next “snapshot.”
git commit -m "message"
Record staged changes with a message.
Tip: Capturing a moment with a caption!
git status
Check which files are staged or unstaged.
Tip: A quick status check of your workspace.
git log
View the commit history.
Tip: Your timeline of changes and actions.
git push
Send local commits to a remote repository.
Tip: Sharing your work with the team.
git pull
Fetch and integrate remote changes.
Tip: Syncing with the latest updates.
git branch
List, create, or delete branches.
Tip: Organize work by creating “paths” for features or fixes.
git merge <branch>
Integrate changes from one branch to another.
Tip: Merging paths for seamless teamwork.
git checkout <branch>
Switch between branches.
Tip: Moving to another track of work.
git reset <file>
Unstage a file from commit.
Tip: Reconsider changes before finalizing.
git diff
See differences since the last commit.
Tip: Quickly spot changes before saving.
git stash
Temporarily save work in progress.
Tip: Store work without committing.
git stash pop
Retrieve stashed changes.
Tip: Resuming where you left off.
git rm <file>
Remove files from the repository.
Tip: Cleaning up unneeded items.
git remote -v
View all remote repositories linked.
Tip: Track and manage your connected locations.
git fetch
Download remote changes without merging.
Tip: Updating data without applying it yet.
git rebase <branch>
Move branch changes onto another branch.
Tip: Reshuffling history for clarity.
git tag <name>
Create a version tag for a specific commit.
Tip: Marking major milestones.
git cherry-pick <commit>
Apply specific commits to another branch.
Tip: Selectively merge useful changes.
git show <commit>
Display details of a commit.
Tip: Zooming in on specific updates.
git blame <file>
Identify who made changes to each line.
Tip: Tracking responsibility line-by-line.
git config
Set user-specific Git configuration.
Tip: Personalizing your setup.
git revert <commit>
Undo a commit without rewriting history.
Tip: Undo with accountability.
git archive
Create an archive file of your project.
Tip: Compress and save everything.
git clean -f
Remove untracked files.
Tip: Clear unused files from your workspace.
git shortlog
Summarize commit history.
Tip: A condensed view of contributions.
git bisect
Locate a bug-causing commit.
Tip: Pinpointing an issue in the history.
git reflog
Review recent actions in Git.
Tip: A log of your entire session history.
🔧 Linux Commands: A Command-Line Toolkit
ls
List files and directories.
Tip: Quick overview of contents.
cd <directory>
Change the current directory.
Tip: Moving around directories.
pwd
Display the current directory path.
Tip: Know exactly where you are.
touch <file>
Create a new, empty file.
Tip: Instantly generate a placeholder.
mkdir <directory>
Create a new directory.
Tip: Organize files into folders.
rm <file>
Delete a file.
Tip: Remove unwanted items.
cp <source> <destination>
Copy files or directories.
Tip: Duplicate files efficiently.
mv <source> <destination>
Move or rename files.
Tip: Organize files by moving or renaming.
cat <file>
Display file content.
Tip: Quick file reading.
echo <text>
Output text to screen or files.
Tip: Display or save simple messages.
chmod <permissions> <file>
Change file permissions.
Tip: Control access to files.
chown <user> <file>
Change file ownership.
Tip: Reassign responsibility.
df -h
View available disk space.
Tip: Know your storage capacity.
du -h <directory>
Display directory size.
Tip: Measure space used by folders.
head <file>
View the start of a file.
Tip: Preview content at the top.
tail <file>
View the end of a file.
Tip: Jump to the last lines.
grep <text> <file>
Search for text within files.
Tip: Find specific lines quickly.
find <directory> -name <filename>
Locate files by name.
Tip: Efficient file searching.
ps aux
Display active processes.
Tip: Check running processes.
kill <process_id>
Terminate a process.
Tip: End tasks that cause issues.
top
View system resource usage.
Tip: Monitor performance in real-time.
whoami
Display current user.
Tip: Identify who’s logged in.
uname -a
View system information.
Tip: Gather system details.
man <command>
Display the manual for a command.
Tip: Access detailed usage info.
history
Show command history.
Tip: Recall past commands.
clear
Clear the terminal screen.
Tip: Refresh the workspace.
alias <shortcut>='<command>'
Create command shortcuts.
Tip: Save time with custom aliases.
scp <source> <user@destination>
Securely copy files to another location.
Tip: Transfer files securely.
Conclusion:
Exploring Git and Linux commands can feel like unlocking new powers every day! This guide provides essential tools, with practical tips to help you achieve more in your DevOps journey. Experiment with these commands to deepen your understanding and keep this sheet handy for a quick reference. Whether managing complex codebases or navigating system operations, these commands simplify your workflow and empower you to work confidently on the command line.
Next Step: Take one new command from this list each day, and experiment with it. Write a script or build a tiny project around it. Your familiarity with these tools will grow with practice, and you’ll find that every line you enter gets you one step closer to command-line fluency!
Subscribe to my newsletter
Read articles from Munilakshmi G J directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Munilakshmi G J
Munilakshmi G J
"Aspiring DevOps Engineer on a 100-day journey to master the principles, tools, and practices of DevOps. Sharing daily insights, practical lessons, and hands-on projects to document my path from beginner to proficient. Passionate about continuous learning, automation, and bridging the gap between development and operations. Join me as I explore the world of DevOps, one day at a time!"