# Day 13- Linux Cheat Sheet

**Basic Commands**

sudo - run &lt;command&gt; in a superuser mode

ls -Listing the files/Directory.

ls -al - Formatted listing with hidden files.

mkdir &lt;directory name&gt; - Create new Directory.

cd &lt;directory name&gt; - Change the directory.

pwd - Present working directory.

touch &lt;file\_name&gt; - Create a new file.

cat &lt;file\_name&gt; - View the contents of the file, Concatenate the file.

rm &lt;file&gt;- Delete the file.

rm-r &lt;dir&gt; - Remove the directory.

cp &lt;file1 file 2&gt; - Copy the file1 to file2.

cp &lt;dir1 dir2&gt;- Copy the dir1 to dir2.

mv&lt;file1 file2&gt; - Rename or move the file.

head &lt;file&gt; - Show the first few lines of the file.

tail &lt;file&gt; - 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 &lt;filename/directory name&gt;- Change the permission of the file

rwx----&gt;Owner has read, write and execute permission 4+2+1=7

rwx---&gt; Group has read, write and execute permission 4+2+1=7

r-x---&gt;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
