Linux:-
File and Directory Operations:
ls
: List files and directories in the current directory.pwd
: Print the working directory.cd
: Change the current directory.touch <filename>
: Create an empty file.mkdir <dirname>
: Create a new directory.rm <file or dir>
: Remove a file or directory (use with caution).mv <source> <destination>
: Move or rename files and directories.cp <source> <destination>
: Copy files and directories.
File Viewing and Editing:
cat <file>
: Display the content of a file.more <file>
orless <file>
: View a file one screen at a time.nano <file>
orvim <file>
: Open a text editor to create or edit files.
File Permissions:
chmod <permissions> <file>
: Change file permissions.chown <user>:<group> <file>
: Change file ownership.
Searching and Finding:
grep <pattern> <file>
: Search for text in files.find <directory> -name <filename>
: Find files and directories.
Process Management:
ps
: List running processes.top
orhtop
: Monitor system activity and processes.kill <PID>
: Terminate a process by its Process ID.
Package Management:
apt-get
orapt
(Debian/Ubuntu): Package management commands for installing, updating, and removing software.yum
(Red Hat/CentOS): Package management commands.
Networking:
ifconfig
orip a
: Display network interface information.ping <hostname or IP>
: Check network connectivity.netstat
: Network statistics.ssh <user>@<host>
: Securely connect to a remote server.
Archiving and Compression:
tar
: Archive files and directories.gzip
,gunzip
,zip
,unzip
: Compress and decompress files.
System Information:
uname -a
: Display system information.df
: Show disk space usage.free
: Display available memory.
User and Group Management:
useradd
,userdel
,usermod
: Manage user accounts.groupadd
,groupdel
,groupmod
: Manage user groups.
File Transfer:
scp
: Securely copy files between hosts.rsync
: Synchronize files and directories.
System Control:
reboot
: Reboot the system.shutdown
: Shut down the system.
Git-Github
Git Commands:
Initializing a Git Repository:
git init
: Initialize a new Git repository in the current directory.
Cloning a Repository:
git clone <repository URL>
: Clone a remote Git repository to your local machine.
Working with Changes:
git status
: View the status of your working directory.git add <file>
: Stage changes for commit.git reset <file>
: Unstage changes.git diff
: Show the differences between the working directory and the staging area.
Committing Changes:
git commit -m "Your commit message"
: Commit staged changes with a descriptive message.git commit -a -m "Your commit message"
: Stage and commit all changes in one command.
Branching:
git branch
: List all local branches.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 the current branch.
Stashing Changes:
git stash
: Temporarily save changes that are not ready to be committed.
Viewing History:
git log
: View commit history.git log --oneline
: View a simplified commit history.
Working with Remotes:
git remote -v
: List remote repositories.git remote add <name> <URL>
: Add a new remote repository.git push <remote> <branch>
: Push local changes to a remote repository.git pull <remote> <branch>
: Pull changes from a remote repository.
GitHub Commands:
GitHub Workflow:
git pull origin main
: Pull changes from themain
branch on GitHub.git push origin main
: Push changes to themain
branch on GitHub.
Collaboration:
Fork a repository on GitHub: Create your own copy of a repository to work on.
Create a Pull Request (PR): Propose changes to the original repository.
Review and merge PRs: Collaborate with others to merge changes into the original repository.
GitHub Issues:
Create issues: Track and discuss tasks or problems.
Mentioning issues: Reference issues in commits or comments using
#
.
GitHub Actions:
- Automate workflows using GitHub Actions for continuous integration and more.
Day 12 of #90daysofDevOps
Thanks for reading
Follow me for more about DevOps♾️........
________________________________________________________________________________
#90daysHardChallenge
#Cloudcomputing
#DevOps
#Kubernetes
#TrainWithShubham