Table of contents
Now that we have completed the Linux & Git-GitHub hands-on in the last 11 days, let's make a cheat sheet of all the commands we have used so far.
Linux Commands -
Navigating the File System:
pwd
: Print the current working directory.ls
: List files and directories.cd
: Change the current directory.mkdir
: Create a new directory.rm
: Remove files or directories.cp
: Copy files or directories.mv
: Move or rename files or directories.
Viewing and Editing Files:
cat
: Display the contents of a file.less
: View file contents interactively.nano
orvim
: Text editors for editing files.head
: Display the beginning of a file.tail
: Display the end of a file.
File Permissions:
chmod
: Change file permissions.chown
: Change file ownership.
Processes and System Management:
ps
: Display information about processes.top
orhtop
: Monitor system processes interactively.kill
: Terminate processes.shutdown
orreboot
: Shutdown or restart the system.
Networking:
ifconfig
orip
: Display or configure network interfaces.ping
: Send ICMP echo requests to a host.ssh
: Securely access remote systems over SSH.netstat
orss
: Display network statistics.
Package Management:
apt
(Debian/Ubuntu) oryum
(Red Hat/Fedora): Package management tools for installing, updating, and removing software packages.dpkg
(Debian/Ubuntu) orrpm
(Red Hat/Fedora): Direct package management tools.
File Compression and Archiving:
tar
: Create, extract, and manipulate archive files.gzip
orgunzip
: Compress or decompress files.zip
orunzip
: Compress or extract files in ZIP format.
User Management:
useradd
: Add a new user.passwd
: Change user password.usermod
: Modify user properties.userdel
: Delete a user.
Disk and Storage Management:
df
: Display disk space usage.du
: Display file and directory space usage.mount
andumount
: Mount and unmount filesystems.
Git-GitHub commands -
Setting up Git:
git config --global
user.name
"Your Name"
git config --global
user.email
"
your@email.com
"
Creating Repositories:
git init
: Initialize a new Git repository in the current directory.git clone <repository_url>
: Clone a remote repository to your local machine.
Managing Changes:
git add <file>
: Add a file to the staging area.git commit -m "Commit message"
: Commit staged changes with a message.git diff
: Show the changes between working directory and staging area.git diff --staged
: Show the changes between staging area and last commit.
Branching and Merging:
git branch
: List all branches in the repository.git branch <branch_name>
: Create a new branch.git checkout <branch_name>
: Switch to a different branch.git merge <branch_name>
: Merge changes from one branch into another.
Updating and Publishing:
git pull
: Fetch and merge changes from a remote repository.git push origin <branch_name>
: Push local changes to a remote repository.
Viewing History:
git log
: Display commit history.git log --oneline
: Display a single commit history.
Stashing Changes:
git stash
: Temporarily save changes that are not ready to be committed.git stash apply
: Apply the most recent stash.
GitHub Commands:
Managing Remote Repositories:
git remote -v
: List remote repositories.git remote add origin <repository_url>
: Add a remote repository named "origin".git push -u origin <branch_name>
: Push and set the upstream branch.git cherry-pick commit_id
: To select specific commits from one branch and apply them to another branch.
Thank you for taking the time to read this blog.