Day 13- Linux Cheat Sheet

Basic Commands
sudo - run <command> in a superuser mode
ls -Listing the files/Directory.
ls -al - Formatted listing with hidden files.
mkdir <directory name> - Create new Directory.
cd <directory name> - Change the directory.
pwd - Present working directory.
touch <file_name> - Create a new file.
cat <file_name> - View the contents of the file, Concatenate the file.
rm <file>- Delete the file.
rm-r <dir> - Remove the directory.
cp <file1 file 2> - Copy the file1 to file2.
cp <dir1 dir2>- Copy the dir1 to dir2.
mv<file1 file2> - Rename or move the file.
head <file> - Show the first few lines of the file.
tail <file> - Show the last few lines of the file.
man - Display the help pages
echo - Display the line of text.
Process Command
ps - Display all the currently active process
top - Display all the running process
kill pid - Kill the process with process id (pid)
File permission and Management
chmod permission <filename/directory name>- Change the permission of the file
rwx---->Owner has read, write and execute permission 4+2+1=7
rwx---> Group has read, write and execute permission 4+2+1=7
r-x--->Other has read and execute permission 4+1=5
find - search for a file
grep - Search for the particular pattern in a file
System Info
date - Show the current date and time.
cal - Show the month calendar.
df - Show the disk usage.
du- Show the directory space usage.
free- Show the memory and swap usage.
Networking Commands-
ping -It checks connectivity between two nodes to see if a server is available.
ssh - It is used to connect to a remote server/system.
ifconfig - Enables us to initialize an interface, assign IP address, and enable or disable an interface.
netstat- It displays information about different interface statistics, including open sockets, routing tables, and connection information.
nslookup -The command is also used to find DNS-related queries.
hostname-Command allows us to set and view the hostname of the system.
curl/wget - Commands are used to download a file from the internet using CLI.
Route - Displays and manipulate IP routing table for your system.
Thanks for Reading 👩💻
Happy Learning 💫
#90daysofdevops
Comments
Join the discussionNo comments yet. Be the first to comment.



