<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Navaneethan Ghanti</title>
    <description>The latest articles on DEV Community by Navaneethan Ghanti (@navv23).</description>
    <link>https://dev.to/navv23</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2282247%2F7df50173-f9e8-4aa0-926a-4618fba53a2f.jpg</url>
      <title>DEV Community: Navaneethan Ghanti</title>
      <link>https://dev.to/navv23</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/navv23"/>
    <language>en</language>
    <item>
      <title>Guide to Networking Commands on Ubuntu</title>
      <dc:creator>Navaneethan Ghanti</dc:creator>
      <pubDate>Tue, 05 Nov 2024 11:28:17 +0000</pubDate>
      <link>https://dev.to/navv23/guide-to-networking-on-ubuntu-33hp</link>
      <guid>https://dev.to/navv23/guide-to-networking-on-ubuntu-33hp</guid>
      <description>&lt;p&gt;In any network, devices communicate based on a unique entity known as IP Address. When communicating with each other, the default gateway routes packets from local network to external network. However, if the communication happens within same network or subnet, default gateway is not necessary, lets understand in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  IPv4 VS IPv6
&lt;/h2&gt;

&lt;p&gt;For any communication to happen over a network, the source IP and destination IP addresses are mandatory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IPv4: This is a 32-bit structure, split into four 8-bit segments. Each segment ranges from 0-255, Here is an example:&lt;code&gt;192.168.1.1&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5fg1j0naqdqr5s52s7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5fg1j0naqdqr5s52s7m.png" alt="IP packet" width="800" height="456"&gt;&lt;/a&gt;&lt;br&gt;Diagram of an IPv4 Packet
  &lt;/p&gt;

&lt;p&gt;The IP packet consists of a header and payload, where the header contains critical information for routing and delivery. Key elements include: the source IP address (indicating the sender) and destination IP address (indicating the recipient), which are essential for communication. Other important fields are the protocol (to identify transport layer protocols), payload length (for data size), and TTL (to prevent endless circulation).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;IPv6: It consists of 128-bit and are represented as eight groups of four hexadecimal digits, separated by colons Here is an example: &lt;code&gt;2001:0db8:85a3:0000:0000:8a2e:0370:7334&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advantages: Offers virtually unlimited address space, enhanced security features, and improved routing efficiency.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Private VS Public IP
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private:&lt;/strong&gt; Addresses that are used within a private network and those are not routable on the internet. They are defined by the following ranges:
Class A: 10.0.0.0 to 10.255.255.255
Class B: 172.16.0.0 to 172.31.255.255
Class C: 192.168.0.0 to 192.168.255.255&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Ideal for LAN's where devices do not require a direct connection to the internet.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public:&lt;/strong&gt; Addresses that are routable on the internet and are assigned by the ISP (Internet service provider).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Subnet Masks
&lt;/h2&gt;

&lt;p&gt;A Subnet mask is crucial part of IP Networking, and determines how the IP addresses are divided into network and host portions. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How it works:
A subnet mask is also a 32-bit number like IPv4, An example of subnet mask would be: &lt;code&gt;255.255.255.0&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binary representation: Each octet in the subnet mask can either by 1 (representing the network part) or 0 (representing the host part), for example subnet mask with &lt;code&gt;255.255.255.0&lt;/code&gt;, the binary representation looks like: &lt;code&gt;11111111.11111111.11111111.00000000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The 1's indicate the first three octets (or the first 24 bits) are used to identify the network. &lt;br&gt;
0's indicate the last octet is used to identify host addresses within the network. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a network with a subnet mask of &lt;code&gt;255.255.255.0&lt;/code&gt;:
The network portion is something like: &lt;code&gt;192.168.1.0&lt;/code&gt;, this means we can have addresses from &lt;code&gt;192.168.1.1&lt;/code&gt; to &lt;code&gt;192.168.1.254&lt;/code&gt; for individual devices (hosts), allowing for 254 usable addresses. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Subnetting divides the larger network into smaller sub networks, this makes the routing of data efficient. Instead of sending data to thousands of devices at once, the routers verify if the destination IP address fall within their range of subnet, If it does, then it allows. If it doesn't it will forward the packet to another router.&lt;/p&gt;

&lt;h2&gt;
  
  
  NAT (Net Address Translation)
&lt;/h2&gt;

&lt;p&gt;This helps multiple devices on a network to share the same public IP, it's a process used by routers and firewalls to modify IP addresses information in packet headers as they pass through a network. Also, NAT acts as a basic firewall, making the devices behing the NAT not visible. &lt;/p&gt;

&lt;h2&gt;
  
  
  Default Gateway
&lt;/h2&gt;

&lt;p&gt;It helps to route the traffic from local network to external network, acts as indermediatory between your local network and other networks, such as internet. &lt;/p&gt;

&lt;p&gt;Example: For home networks, this is often the router assigned an IP address like &lt;code&gt;192.168.1.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5338mahzvtiac9hql6mv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5338mahzvtiac9hql6mv.png" alt="Default gateway" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;Illustration of a default gateway
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Networking Commands on Ubuntu:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic Connectivity Checks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ping: Test the connecitivty to the remote host.&lt;br&gt;
&lt;code&gt;ping google.com&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;traceroute: Traces the route packets take to destination.&lt;br&gt;
&lt;code&gt;traceroute google.com&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;nslookup/dig: Queries DNS to obtain domain name or IP address mapping.&lt;br&gt;
&lt;code&gt;nslookup google.com&lt;/code&gt; OR &lt;code&gt;dig google.com&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mtr&lt;/code&gt;: My traceroute, It provides real-time data on the route the packets take from source to destination, while also measuring latency, packet loss, at each hop. This command combines &lt;code&gt;traceroute&lt;/code&gt; and &lt;code&gt;ping&lt;/code&gt;, for example: &lt;code&gt;mtr meta.com&lt;/code&gt;, the output you get contains the following information. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Network Configuration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ifconfig&lt;/code&gt;: Displays or configures network interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;hostname&lt;/code&gt;: Displays the system hostname&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Network Interface Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ip link show&lt;/code&gt;: To display the information about network interfaces, and their status (up or down), and MAC Addresses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ip addr show&lt;/code&gt;: To display IP address assigned to each network interface, useful for confirming your current IP configuration. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Routing and IP Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ip route show&lt;/code&gt;: To view the routing table, which shows how the packets are handled in a network, this command also shows your default gateway.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;route -n&lt;/code&gt;: To display the routing table in a format that includes network destinations, gateways and interface information. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monitoring and Debugging Network Connections
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ss -tuln&lt;/code&gt;: Socket statistics, useful to view the open/listening ports, useful for monitoring active network services, -t=TCP sockets, -u=UDP sockets, -l=LISTENING sockets, -n=DISPLAYS NUMERIC ADDRESSES AND PORTS. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a0zj1qwt126lrkiwt7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a0zj1qwt126lrkiwt7u.png" alt="socket statistics" width="800" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can be useful to monitor the services that are running on particular ports.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ip neigh show&lt;/code&gt;: To display the ARP table, which maps IP addresses to MAC address, useful for troubleshooting local networks. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Firewall Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ufw&lt;/code&gt;: Useful for managing firewall status and to prevent the users from unauthorized access, some of the commands are: enable/disable it: &lt;code&gt;sudo ufw enable&lt;/code&gt; and &lt;code&gt;sudo ufw disable&lt;/code&gt;, and &lt;code&gt;sudo ufw status&lt;/code&gt; to know the status, For example, &lt;code&gt;sudo ufw allow 22&lt;/code&gt;, allows SSH connections, useful for remote management, By default UFW recognizes common service names.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Packet Analysis
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tcpdump -i 'network_interface'&lt;/code&gt;: For example &lt;code&gt;tcpdump -i eth0&lt;/code&gt; captures packets on eth0 interface, &lt;code&gt;tcpdump -i eth0 'tcp'&lt;/code&gt; shows only the TCP packets. &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Host:&lt;/strong&gt; The hostname or IP address of each hop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loss%:&lt;/strong&gt; The percentage of packet loss for each hop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Snt:&lt;/strong&gt; The number of packets sent to each hop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Last:&lt;/strong&gt; The latency of the last packet sent to that hop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avg:&lt;/strong&gt; The average latency over all packets sent to that hop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best:&lt;/strong&gt; The best (lowest) latency recorded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrst:&lt;/strong&gt; The worst (highest) latency recorded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;StDev:&lt;/strong&gt; The standard deviation of the latency, indicating variability.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How packet analysis help troubleshooting?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identify packet loss:&lt;/strong&gt; high packet loss indicates network issues, which might be due to congestion, hardware problems or configuration. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Analyzing Latency:&lt;/strong&gt; To figure out where delays are occuring on a network, this can help identify bottleneck or overloaded device. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tracking connection errors:&lt;/strong&gt; Errors like TCP retransmission, resets, or incomplete handshakes, which may indicate problems establishing or maintaining connections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unauthorized access:&lt;/strong&gt; Can reveal unusual sources or patterns of traffic. this can help identifying security attacks, scans or unauthorized attempts. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Network Scanning and Discovery
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;nmap google.com&lt;/code&gt;: Network-mapper, useful for network exploration, management and security. It helps us to discover hosts, scan ports, service version detection, OS detection, network mapping and more. 
For example, &lt;code&gt;nmap google.com&lt;/code&gt; OR &lt;code&gt;nmap &amp;lt;destination_ip&amp;gt;&lt;/code&gt; will perform default scan on the hosts, &lt;code&gt;-p&lt;/code&gt; option helps us scan specific ports &lt;code&gt;-sV&lt;/code&gt; helps in service version detection, -o helps in OS detection. It is useful to gather critical information about the network and also used in penetration testing, to know more about nmap run &lt;code&gt;man nmap&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This beginners guide covers most of the necessary concepts and command for networking, feel free to experiment it on your own and undestand each of the low-level details one by one. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks for reading, Any Suggestions or feedback would be highly appreciated! &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>networking</category>
      <category>devops</category>
      <category>beginners</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Complete Linux Essentials!</title>
      <dc:creator>Navaneethan Ghanti</dc:creator>
      <pubDate>Sun, 03 Nov 2024 15:32:50 +0000</pubDate>
      <link>https://dev.to/navv23/complete-linux-essentials-6n4</link>
      <guid>https://dev.to/navv23/complete-linux-essentials-6n4</guid>
      <description>&lt;h2&gt;
  
  
  The Prompt
&lt;/h2&gt;

&lt;p&gt;Open up the terminal, We see our prompt:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kd7i6et2vxh183o5rv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kd7i6et2vxh183o5rv7.png" alt="prompt" width="318" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;which includes your username@machinename, followed by a ~ and then a $,  &lt;strong&gt;~&lt;/strong&gt; represents home directory and &lt;strong&gt;$&lt;/strong&gt; represents that you are a regular user and not a super user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the command structure
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;command -options arguments&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;-options: modifies the command behaviour, enables us to provide single or multiple options for a command. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;arguments: many commands accepts arguments, these are the things that the command acts upon or uses. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: Commands are case sensitive.&lt;/p&gt;

&lt;p&gt;Example: &lt;br&gt;
&lt;code&gt;sort -r file.txt&lt;/code&gt;, -r is an option(s) and file.txt is an argument. &lt;/p&gt;

&lt;h2&gt;
  
  
  Man Pages
&lt;/h2&gt;

&lt;p&gt;Reference Manual page for commands, we can view the details of a command by running&lt;br&gt;
&lt;code&gt;man touch&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of commands
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;External commands: An executable program, usually stored in &lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/usr/bin&lt;/code&gt;, or &lt;code&gt;/usr/local/bin&lt;/code&gt;, Every command we run is a file on the system, its a compiled binary file.&lt;br&gt;
Note: you can see where your command file is stored by running &lt;code&gt;which &amp;lt;commandname&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internal commands: A built in shell command, these are part of the shell (bash) and are not part of executable files, the shell executes them directly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shell Functions: Shell functions are blocks of code that group commands together in a reusable way, they allow users to define their own commands within scripts. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alias: It is a shortcut for a command or a series of command, this can be defined in terminal session (temporary) or in &lt;code&gt;.bashrc&lt;/code&gt; file (permanent). &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Redirection
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpufrzcai3fcv9c7pycxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpufrzcai3fcv9c7pycxv.png" alt="redirection" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Redirection is the process of routing the standard input, standard output and standard error into a file or a program.&lt;/p&gt;

&lt;p&gt;Each stream (input, output, error) gets its own numeric descriptor, standard input=0, standard output=1 and standard error=2.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Redirecting the standard input: &lt;code&gt;command &amp;lt; input.txt&lt;/code&gt;, contents of the file will act as the standard input and will be redirected to the command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redirecting the standard output: if you run &lt;code&gt;ls -l &amp;gt; files.txt&lt;/code&gt;, the contents will be stored in files.txt.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redirecting the standard error: &lt;code&gt;cat unknownfile 2&amp;gt; error.txt&lt;/code&gt;, here, 2&amp;gt; is the standard error redirection operator, the contents will be stored in error.txt.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Redirecting standard output and standard error to the different VS same file using numeric descriptor. &lt;br&gt;
&lt;code&gt;ls docs &amp;gt; output.txt 2&amp;gt; output.txt&lt;/code&gt; AND &lt;code&gt;ls docs &amp;gt; output.txt 2&amp;gt;&amp;amp;1&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Absolute VS Relative Path
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Absolute Path: This starts from ROOT(/) directory, &lt;code&gt;/home/user1/Desktop/file.txt&lt;/code&gt; which has the complete path route.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Relative Path: Assuming we are in &lt;code&gt;/home/user1/Desktop/&lt;/code&gt; directory already, we can navigate to a folder called &lt;em&gt;tests&lt;/em&gt; by running &lt;code&gt;cd tests&lt;/code&gt;, this is because this is already in relation to our current working directory, and doesn't need an absolute reference. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Symbolic links
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ln -s /your/long/path ~/shortcut&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ln&lt;/code&gt; is the command to create links.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-s&lt;/code&gt; specifies it should be symbolic (or soft)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/your/long/path&lt;/code&gt; is the full directory path you want the shortcut for&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/shortcut&lt;/code&gt; is the location and name for your symbolic link, which you can adjust as needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once created, you would navigate to your long path directory by using your shortcut &lt;code&gt;cd ~/shortcut&lt;/code&gt;&lt;br&gt;
Symbolic links remain persistent accross sessions, In order to remove the shortcuts, &lt;code&gt;rm ~/shortcut&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  File and Directories Handling
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creating files and Folders
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;touch colors.txt&lt;/code&gt; will create colors.txt.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mkdir templates&lt;/code&gt; will create a folder called templates.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Copying, Moving, and Deleting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cp colors.txt /home/user1/Desktop/new/&lt;/code&gt; will copy the &lt;code&gt;colors.txt&lt;/code&gt; file to the specified path, and &lt;code&gt;cp new/ /home/user1/Desktop/updated_new/&lt;/code&gt;, will copy entire folder contents into the updated_new folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mv colors.txt /home/user1/Desktop/new/&lt;/code&gt; will move the &lt;code&gt;colors.txt&lt;/code&gt; file to the specified path, and &lt;code&gt;mv new/ /home/user1/Desktop/updated_new/&lt;/code&gt;, will move the entire folder contents into the updated_new folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;rm colors.txt&lt;/code&gt; will delete colors.txt&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;rm -d &amp;lt;foldername&amp;gt;&lt;/code&gt;, deletes empty directories. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;rm -r &amp;lt;foldername&amp;gt;&lt;/code&gt;, deletes folder and subfolder's in &lt;em&gt;recursive&lt;/em&gt; mode. use &lt;code&gt;-f&lt;/code&gt; option to delete everything by recursive force.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Listing Directories
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt; displays the contents of a folder, &lt;code&gt;-l&lt;/code&gt; option helps us to view it in long form, &lt;code&gt;-la&lt;/code&gt; helps us to see the longform + hidden files and   &lt;code&gt;-lah&lt;/code&gt; option shows the human readable format.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Useful Commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;pwd&lt;/code&gt;, prints the current working directory. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cd &amp;lt;dirname&amp;gt;&lt;/code&gt;, changes the current working directory to the mentioned directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cat &amp;lt;filename&amp;gt;&lt;/code&gt;, Displays the contents of a file on the terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;more &amp;lt;filename&amp;gt;&lt;/code&gt;, Views a file, page by page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;less &amp;lt;filename&amp;gt;&lt;/code&gt;, Similar to more, but allows backward scrolling. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;nano &amp;lt;filename&amp;gt;&lt;/code&gt;, text editor that enables editing of a file. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;whoami&lt;/code&gt;, shows the username of the current user. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Permissions
&lt;/h2&gt;

&lt;p&gt;These are of three types: read, write and execute, the numeric descriptors for them are read=4, write=2 and execute=1, the file permissions for a file or folder can be viewed by listing the content of the diretories, &lt;code&gt;ls -l&lt;/code&gt;, the first column displays the file permissions and the third column is user and fourth column is the group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh1boytjtf1vtxukrl4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh1boytjtf1vtxukrl4x.png" alt="File Permissions" width="660" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Owner, Group and World?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;User(u): there can be multiple users on the system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Group(g): Users can belong to a group which are given access to a particular files or folder. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;World(o): Anyone apart from owner and not in group.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Altering Permissions
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;chmod &amp;lt;permissiontype&amp;gt;&lt;/code&gt; &lt;br&gt;
for example, we can change the users permissions for a file or a folder by saying, &lt;code&gt;chmod u+rw file.txt&lt;/code&gt; (change mode for user, add permissions read and write for the file named file.txt)&lt;/p&gt;

&lt;p&gt;or we can do it numerically, giving all read, write and execute access for all of the roles by saying &lt;code&gt;chmod 777 file.txt&lt;/code&gt; (change mode, give read, write and execute access for all of the roles).&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment Variables
&lt;/h2&gt;

&lt;p&gt;Shell maintains set of information during a shell session known as the environment, It is just a series of key value pairs separated by equals to sign, that define properties like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your home directory&lt;/li&gt;
&lt;li&gt;Your working directory&lt;/li&gt;
&lt;li&gt;The name of your shell&lt;/li&gt;
&lt;li&gt;The name of the logged in user&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Viewing the Environment
&lt;/h3&gt;

&lt;p&gt;Type &lt;code&gt;printenv&lt;/code&gt; in the terminal, to view the environment variables and their current values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parameter Expansion
&lt;/h3&gt;

&lt;p&gt;You can print out an environment variable with an dollar sign using echo command, for example,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo $USER&lt;/code&gt;, will print out the current user who is logged in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Defining Variables
&lt;/h3&gt;

&lt;p&gt;You can define a variable by saying variable=value, for example &lt;code&gt;color=’purple’&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Aliases
&lt;/h3&gt;

&lt;p&gt;You can your own commands by using an alias keyword, for example,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias ll = ‘ls -l’&lt;/code&gt;, now you can run ll instead of &lt;code&gt;ls -l&lt;/code&gt;, remember setting alias will affect the shell session only, look on how to add it to global config file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Startup Files
&lt;/h3&gt;

&lt;p&gt;When we login, shell reads information from startup files, First, shell reads from global config file that affects the environment all of the users, Then, shell reads startup files for specific users.&lt;/p&gt;

&lt;p&gt;The specific files the shell reads from depends on the type of session, login vs non-login session.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Login Sessions:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;/etc/profile&lt;/code&gt; : global config for all users.&lt;br&gt;
&lt;code&gt;~/.bash_profile&lt;/code&gt; : user’s personal config file.&lt;br&gt;
&lt;code&gt;~/.bash_login&lt;/code&gt; : read if bash_profile isn’t found.&lt;br&gt;
&lt;code&gt;~/.profile&lt;/code&gt; : used if previous two aren’t found.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Non-Login Sessions:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;etc/bash.bashrc&lt;/code&gt; : global config for all users&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.bashrc&lt;/code&gt; :specific settings for each user. This is where we can define our own settings and configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shortcuts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ctrl-l : clears the commands in the terminal.&lt;/li&gt;
&lt;li&gt;ctrl-a : move the cursor in the terminal to the beginning of the line.&lt;/li&gt;
&lt;li&gt;ctrl-e : to move the cursor to the end of the line.&lt;/li&gt;
&lt;li&gt;ctrl-f : to move the cursor forward by one character.&lt;/li&gt;
&lt;li&gt;ctrl-b : to move the cursor backward by one character.&lt;/li&gt;
&lt;li&gt;alt-f : to move the cursor forward by one word.&lt;/li&gt;
&lt;li&gt;alt-b : to move the cursor backward by one word.&lt;/li&gt;
&lt;li&gt;ctrl-k : to kill the text from the current cursor location until the end of the line&lt;/li&gt;
&lt;li&gt;ctrl-u : to kill the text from the current cursor location until the beginning of the line.&lt;/li&gt;
&lt;li&gt;ctrl-y : to retrieve the most recently killed text.&lt;/li&gt;
&lt;li&gt;history : to see the list of commands we have previously entered, we can see the actual file at &lt;code&gt;~/.bash_history&lt;/code&gt;, run this command if you want to run a specific line from the history, !223 to run the 223rd line from the history.&lt;/li&gt;
&lt;li&gt;ctrl-r : to enter “reverse-i-search”, as you start typing, bash will search the history and show you the best match.&lt;/li&gt;
&lt;li&gt;ctrl-w : to kill the word from the current cursor position to the beginning of the word.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This blog defines the necessary linux concepts to get started and to build a foundation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks for reading, Any Suggestions or Feedback is Highly Appreciated!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
