Skip to main content

Command Palette

Search for a command to run...

Day 12 : Linux and Git-GitHub cheatsheet

Published
โ€ข4 min readโ€ขView as Markdown
Day 12 : Linux and Git-GitHub cheatsheet

I'm thrilled to share with you a comprehensive and creatively designed cheat sheet that covers all the essential commands you've learned during the Linux & Git-GitHub hands-on journey. ๐Ÿค“ Whether you're a beginner or an experienced developer, this cheat sheet will be your go-to reference for daily tasks. Let's dive in and level up our skills!

Linux Commands ๐Ÿง

๐Ÿš€Table of Contents ๐Ÿ“‘

SectionCommands Covered
File Manipulationls, cd, cp, mv, rm
Text Processingcat, grep, sed, awk
System Informationuname, df, top, ps
Package Managementapt, yum, dnf, pacman
Network Managementping, ifconfig, netstat
User Administrationuseradd, passwd, sudo
File Permissionschmod, chown, chgrp
Compressiontar, zip, unzip, gzip
Task Automationcron, at, systemd

File Manipulation ๐Ÿ“‚

Command

Usage

ls๐Ÿ“„๐Ÿ“

List files and directories

cd๐Ÿšช๐Ÿ“‚

Change directory

cp๐Ÿ“โžก๏ธ๐Ÿ“ฆ

Copy files or directories

mv๐Ÿššโœจ

Move or rename files

rm๐Ÿ—‘๏ธ๐Ÿšซ

Remove files or directories

Text Processing โœ‰๏ธ

Command

Usage

cat๐Ÿฑ๐Ÿ“„

Display file content

grep๐Ÿ”๐Ÿ“ƒ

Search text in files

sed๐ŸŒŠ๐Ÿ–‹๏ธ

Stream text editor

awk๐Ÿฆ‰๐Ÿ”ง

Text manipulation tool

System Information ๐Ÿ’ป

Command

Usage

uname๐Ÿ’ก๐Ÿ”

Display system information

df๐Ÿ’ฝ๐Ÿ“Š

Disk space usage

topโซ๐Ÿ”„

Monitor system processes

ps๐Ÿ”„๐Ÿ“‹

Display running processes

Package Management ๐Ÿ“ฆ

Command

Usage

apt๐Ÿ“ฆ๐Ÿ”—

Debian/Ubuntu package manager

yum๐Ÿฅก๐Ÿ“ฆ

CentOS/Fedora package manager

dnf๐ŸŒŸ๐Ÿ“ฆ

Next-gen Fedora package mgr

pacman๐Ÿง๐Ÿ“ฆ

Arch Linux package manager

Network Management ๐ŸŒ

Command

Usage

ping๐Ÿ“๐ŸŒ

Check network connectivity

ifconfig๐Ÿ“ก๐Ÿ”Œ

Network interface config

netstat๐Ÿ“Š๐ŸŒ

Network statistics

User Administration ๐Ÿ‘ค

Command

Usage

useradd๐Ÿ‘ฅโž•

Add a user

passwd๐Ÿ”๐Ÿ”’

Change user password

sudo๐Ÿฆธโ€โ™‚๏ธ๐Ÿ›ก๏ธ

Execute commands with superuser

File Permissions ๐Ÿ”

Command

Usage

chmod๐Ÿ”๐Ÿ”’

Change file permissions

chown๐Ÿ‘ค๐Ÿ”ง

Change file owner

chgrp๐Ÿ‘ฅ๐Ÿ”ง

Change file group

Compression ๐Ÿ“ฆ

Command

Usage

tar๐Ÿ“ฆ๐Ÿ”—

Archive files

zip๐Ÿค๐Ÿ”—

Create compressed zip archive

unzip๐Ÿ—ƒ๏ธ๐Ÿ”“

Extract files from zip archive

gzip๐ŸŒช๏ธ๐Ÿ“ฆ

Compress files

Task Automation โฐ

Command

Usage

cronโฒ๏ธ๐Ÿ“…

Schedule tasks

at๐Ÿ•’๐Ÿš€

Execute commands once

systemd๐Ÿ”„๐Ÿ› ๏ธ

System and service manager

Git-GitHub Commands ๐ŸŒฑ

Command

Description

Example Usage

git init

Initialize a new Git repository.

git init (Start tracking current directory)

git clone

Clone a repository from a URL.

git clone <URL> (Clone a repository)

git add

Add changes to the staging area.

git add file.txt (Stage changes)

git commit

Commit staged changes with a message.

git commit -m "Added new feature" (Commit with message)

git pull

Fetch and merge changes from a remote repository.

git pull origin main (Pull changes from "main" branch)

git push

Push local changes to a remote repository.

git push origin develop (Push to "develop" branch)

git branch

List, create, or delete branches.

git branch feature (Create "feature" branch)

git merge

Merge two or more branches.

git merge feature (Merge "feature" into current branch)

git log

Display commit history.

git log --oneline (Compact commit history)

git reset

Unstage changes or reset to a previous commit.

git reset HEAD file.txt (Unstage changes)

git stash

Temporarily save changes without committing.

git stash save "WIP" (Stash changes)

git remote

Manages remote repositories

git remote add origin https://github.com/user/repo.git

git status

Shows the status of your working directory

git status

Conclusion

Feel free to share this cheat sheet with your fellow developers and friends! Let's make learning and collaborating even more exciting and productive! ๐ŸŒŸ

Remember, knowledge grows when shared. ๐ŸŒฑ Keep coding, keep exploring, and keep building amazing things! ๐Ÿš€

#HappyLearning #DevOpsCommunity #LinuxGitCheatSheet

More from this blog

Untitled Publication

24 posts