Day 11 Task: Linux & Github cheat-sheet
Maninder Singh
AWS || Networking || Docker || Mentor & Tutor || System Engineer Antier Solution
In the Previous tasks, I have uploaded the Devops basics, Linus, shell Scripting, Git & GitHub. Now in these task we are learn Linux and GitHub commands.
Linux Commands:
# To check your present working directory:
pwd
# List of all the files or directories
ls
# Lists hidden files or directories:
ls -a
# Create new directory:
mkdir <directory name>
# Multiple directory creation:
mkdir -p A/B/C/D
# Remove directory
rmdir <directory name>
# remove multiple directories.
rm -rf <directory name>
# Remove files:
rm <file name>
# change directory
cd <path where to move>
# create an empty file
touch <file name>
# copy file
cp <source path> <destination path>
# move file
mv <source path> <destination path>
# To write some content inside a file
# To read the content without open a file
echo <message> > file name
cat <file name>
# history (for check all running commands)
# search a word
grep string <file name>
# return the specified number of lines from the top
head /etc/passwd
# Return the specified number of lined from the bottom.
tail /etc/passwd
# To show the disk space
df -H
File Permissions:
# to change the permission of a file
# To change the file or directory ownership
sudo chown <username> <filename>
领英推荐
# To change the group ownership
sudo chgrp <groupname> <filename>
User Managemnet:
# To create a new user
sudo add user <username>
# To set a password for user
sudo passwd <username>
Git Commands:
After Linux cheat sheet, now let us discuss the Git cheat sheet
# to initialise empty git repository, transforms the current directory into a git.list of all remote repositories.
# Clone an existing repository:
# Add files and changes from the working directory to the staging area.
# Add all current directory files to git:
# Commit all the staged files to git.
# To show the status of git repository:
Git Branch
# To list of all the branches
# Create a new branch:
# For going to specific branch:
# for creating and going to that branch:
Remote Origin:
# list of all remote repositories that are currently connected to local repository
# To add remote origin url:
# To remove remote orgin url:
# To upload local repository content to a remote repository
# To pull your remote repository content to local repository
# To fetech down all the branches form the git remote
To check you git commit logs:
Git configuration
# To set a author name for all the commits by the current user:
# To set author email to be used for all the commits by the user:
# To merge the 2 branches in Git:
Thank you for reading this article!!
Happy Learning !!
Next Topic:
Day 12: Basics of Python!!
Hello Maninder... We post 100's of job opportunities for developers daily here. Candidates can talk to HRs directly. Feel free to share it with your network. Visit this link - https://jobs.hulkhire.com And start applying.. Will be happy to address your concerns, if any