Linux & Git Cheat Sheet
Linux & Git Cheat Sheet
example:
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 2.18953 s, 981 MB/s
Note: The output of the dd command may vary based on your system's performance.
hdparm -Tt /dev/sda: Measure the read speed of your hard drive 💽📶
This command will measure the read speed of your hard drive (/dev/sda) and display
the result in MB/sec.
example:
/dev/sda:
Timing cached reads: 20124 MB in 2.00 seconds = 10076.39 MB/sec
Timing bu ered disk reads: 588 MB in 3.01 seconds = 195.47 MB/sec
💡 Others:
yes > /dev/null &: Use this command to push a system to its limit 💡🏁
Running this command will continuously print the letter "y" and redirect the output to
/dev/null, which discards it. The process will run in the background.
example:
:(){ :|:& };::: A fork bomb – handle with care. Do not run this command on a production
system 💣🚫
:(){ :|:& };:
Warning: Do not run this command on a production system or any system you care
about. It is a fork bomb and can quickly consume system resources, causing the
system to become unresponsive or crash.
A fork bomb is a self-replicating program that creates a large number of child processes,
overwhelming the system. It can be executed as follows:
$ :(){ :|:& };:
If you accidentally run this command, you may need to restart your system to recover from
its e ects.
🗓 Cron Jobs:
🗒🕰
crontab -l: List all your cron jobs
crontab -e: Edit your cron jobs✏🗒
crontab -r: Remove all your cron jobs ❌🗒
🕰🗒
crontab -v: Display the last time you edited your cron jobs
🗒🔄
crontab file: Install a cron job from a file
@reboot command: Schedule a job to run at startup 🗒⏰🔃
Git Cheat sheet
🔄 Git Commands:
🔄📦
git init: Initialize a local git repository
git clone url: Create a local copy of a remote repository 🔄🔗📦
🔄📄➕
git add filename: Add a file to the staging area
🔄✍📦
git commit -m "Commit message": Commit changes with a message
🔄📦
git status: Check the status of the working directory
🔄🔃📦
git pull: Pull latest changes from the remote repository
🔄🔃📦
git push: Push changes to the remote repository
🔄🌳
git branch: List all local branches
git branch branchname: Create a new branch 🔄🌳➕
git checkout branchname: Switch to a branch 🔄🌳 ⬅➡
🔄🌳🔄
git merge branchname: Merge a branch into the active branch
🔄🔒
git stash: Stash changes in a dirty working directory
git stash apply: Apply changes from a stash🔄🔒 ➡
git log: View commit history🔄📜
🔄🔙
git reset: Reset your HEAD pointer to a previous commit
🔄📄❌
git rm filename: Remove a file from version control
🔄🔄
git rebase: Reapply commits on top of another base tip