Table of contents
day12 of #90daysofdevops
Linux Commands
ls: List files and directories.
cd [directory]: Change directory.
pwd: Print working directory.
mkdir [directory]: Create a directory.
rm [file]: Remove a file.
rm -r [directory]: Remove a directory and its contents.
cp [source] [destination]: Copy files or directories.
mv [source] [destination]: Move or rename files or directories.
cat [file]: Display file contents.
grep [pattern] [file]: Search for a pattern in files.
chmod [permissions] [file]: Change file permissions.
chown [user] [file]: Change file ownership.
ssh [user@host]: Securely connect to a remote server.
sudo [command]: Run a command with superuser privileges.
apt-get [package]: Install or manage packages on Debian-based systems.
yum [package]: Install or manage packages on RPM-based systems.
man [command]: Display the manual page for a command.
history: View command history.
wget [URL]: Download files from the web.
tar [options] [file]: Compress or extract files from an archive.
df: Display disk space usage.
du [directory]: Estimate file and directory space usage.
find [directory] [options]: Search for files and directories.
grep -r [pattern] [directory]: Recursively search for a pattern in files.
ps: Display running processes.
top: Monitor system activity and processes.
kill [process_id]: Terminate a process.
ifconfig: Display or configure network interfaces.
ping [host]: Send ICMP echo requests to a host.
ssh-keygen: Generate SSH key pairs.
scp [file] [user@host:destination]: Securely copy files between hosts.
mount [device] [directory]: Mount a filesystem.
umount [directory]: Unmount a filesystem.
chmod +x [file]: Make a file executable.
df -h: Display disk space usage in human-readable format.
uptime: Show system uptime and load average.
head [file]: Display the first lines of a file.
tail [file]: Display the last lines of a file.
zip [options] [archive] [files]: Create a ZIP archive.
unzip [archive]: Extract files from a ZIP archive.
ln -s [source] [link_name]: Create a symbolic link.
history [number]: Show the last [number] of commands from history.
apt-cache search [keyword]: Search for packages by keyword.
nc [options] [host] [port]: Connect and send data to a network host.
rsync [options] [source] [destination]: Synchronize files and directories.
dd [options] [if=input] [of=output]: Convert and copy a file.
whoami: Display the current user.
basename [path]: Get the base name of a file path.
cut -d [delimiter] -f [fields] [file]: Extract specific fields from a file.
date: Display the current date and time.
Git and Github Commands
git init: Initialize a new Git repository.
git clone [repository_url]: Clone a repository from a remote server.
git add [file]: Add a file to the staging area.
git add .: Add all files to the staging area.
git commit -m "[message]": Commit changes to the repository.
git commit -a -m "[message]": Stage and commit changes.
git push: Push changes to a remote repository.
git push -u [remote] [branch]: Push changes and set the upstream branch.
git pull: Fetch and merge changes from a remote repository.
git fetch: Download changes from a remote repository.
git merge [branch_name]: Merge changes from another branch.
git branch: List branches in the repository.
git branch [branch_name]: Create a new branch.
git branch -d [branch_name]: Delete a branch.
git checkout [branch_name]: Switch to a different branch.
git checkout -b [branch_name]: Create and switch to a new branch.
git status: Show the status of the repository.
git log: Display the commit history.
git log --graph: Show the commit history with a graph.
git remote: Manage remote repositories.
git remote -v: List remote repositories and their URLs.
git remote add [name] [url]: Add a new remote repository.
git remote remove [name]: Remove a remote repository.
git stash: Save changes that are not ready to be committed.
git stash list: List stashed changes.
git stash apply: Apply the most recent stash.
git stash drop: Discard the most recent stash.
git revert [commit]: Revert a commit.
git reset [commit]: Reset the repository to a previous commit.
git reset --hard [commit]: Reset the repository and discard changes.
git tag: Create, list, or delete tags.
git tag [tag_name]: Create a new tag.
git tag -a [tag_name] -m "[message]": Create an annotated tag.
git tag -d [tag_name]: Delete a tag.
git show [commit]: Show information about a commit.
git diff: Show changes between commits, branches, or files.
git blame [file]: Show who last modified each line of a file.
git config --global user.name "[name]": Set the author name for commits.
git config --global user.email "[email]": Set the author email for commits.
git config --global alias.[alias_name] "[command]": Create a Git alias.
git cherry-pick [commit]: Apply a specific commit to the current branch.
git rebase [branch]: Reapply commits on top of another branch.
git bisect [options]: Use binary search to find a faulty commit.
git remote show [remote_name]: Show information about a remote repository.
git submodule add [repository_url] [directory]: Add a submodule to the repository.
git submodule update --init: Initialize and update submodules.
git clean -n: Show files and directories that are not tracked.
git clean -f: Remove untracked files and directories.
git log --oneline: Show the commit history in a simplified format.
git log --author="[author_name]": Show the commit history by a specific author.
Thanks for Reading!!
Prajwal~~