Linux Fundamentals WEEK 2

Linux Fundamentals WEEK 2

Linux fundamentls (Processes Package management ), Git &GitHUB and Networking concepts

Linux Process Management

Learning how to manage processes in Linux was both fascinating and a bit challenging. Commands like ps, top, and kill gave me a new perspective on how operating systems handle applications and processes in real-time. For example, understanding the difference between ps aux and top took some trial and error, especially while figuring out which processes belonged to which users.

One specific problem I encountered was with kill commands. Initially, I tried to terminate a process by name using pkill, but it didn’t work as expected because I didn’t specify the exact process name. This led me to dive deeper into filtering processes with ps and understanding the PID system.

Linux Package Management

Working with apt commands taught me the importance of keeping software updated while avoiding unnecessary installations. Commands like sudo apt update, sudo apt upgrade, and sudo apt autoremove showed me how to maintain a clean and efficient system. At first, I accidentally removed a package along with its configuration files using sudo apt purge, which broke a dependency for another tool I was using. This mistake highlighted the importance of understanding the impact of each command before execution.


Networking Concepts

  1. IP Addressing

    • An IP address is a unique identifier assigned to each device connected to a network. It allows devices to communicate with each other.
  2. Subnetting

    • Subnetting is the process of dividing a network into smaller subnetworks. It helps in efficient IP address management and improves network performance.
  3. MAC Address

    • A MAC address is a hardware identifier assigned to network interfaces. It is used for communication within a local network segment.
  4. DNS (Domain Name System)

    • DNS translates human-readable domain names (like www.example.com) into IP addresses that computers use to identify each other on the network.
  5. DHCP (Dynamic Host Configuration Protocol)

    • DHCP is a network management protocol used to automatically assign IP addresses and other network configuration parameters to devices on a network.
  6. TCP/IP Model

    • The TCP/IP model is a set of protocols used to interconnect network devices on the internet. It includes layers such as the application, transport, internet, and network access layers.
  7. OSI Model

    • The OSI model is a conceptual framework used to understand and implement network protocols in seven layers: physical, data link, network, transport, session, presentation, and application.
  8. Routing

    • Routing is the process of selecting paths in a network along which to send network traffic. Routers are devices that forward data packets between networks.
  9. Switches and Hubs

    • Switches and hubs are networking devices used to connect multiple devices on a local network. Switches operate at the data link layer, while hubs operate at the physical layer.
  10. Firewalls

    • Firewalls are security devices that monitor and control incoming and outgoing network traffic based on predetermined security rules. They help protect networks from unauthorized access and cyber threats.

Basic Commands in Git

  1. git init

    • This command creates a new, empty Git repository. It adds a hidden .git folder to your project directory, which Git uses to store all the information about your repository.
  2. git config

    • This command is used to configure your Git settings. For example, you can use it to set your name and email address, which will be associated with your commits. You can also set the default branch name to main, which is now standard practice.
  3. git status

    • This command shows you the current state of your repository. It tells you which files are modified, which files are staged for commit, and which files are untracked.
  4. git add

    • This command adds files to the staging area. When you add a file, Git starts tracking it and includes it in the next commit.
  5. git commit

    • This command creates a new commit. A commit is like a snapshot of your repository at a specific point in time. Each commit has a message associated with it, which describes the changes that were made in that commit.
  6. git log

    • This command shows you the history of your commits. You can see the commit message, the author of the commit, the date and time of the commit, and the commit hash.
  7. git branch

    • This command is used to create, list, rename and delete branches. A branch is a parallel version of your project. You can create a new branch to work on a new feature without affecting the main branch.
  8. git checkout

    • This command is used to switch between branches. When you check out a branch, Git updates your working directory to reflect the state of that branch.
  9. git merge

    • This command is used to merge two branches together. When you merge a branch, Git combines the changes from that branch into the current branch.
  10. git push

    • This command is used to push your local commits to a remote repository. A remote repository is a copy of your repository that is hosted on a server, such as GitHub or GitLab.
  11. git pull

    • This command is used to pull changes from a remote repository to your local repository. This ensures that your local repository is up to date with the latest changes.

Git Branch Commands

  1. Create a Branch

    • git branch branch_name - to create a new branch. To create and switch to a new branch directly, use git checkout -b branch_name.
  2. View Branches

    • List local branches using git branch.

    • List all branches (local and remote) - git branch -a.

    • View only remote branches using git branch -r.

  3. Switch Branches

    • Switch to an existing branch - git checkout branch_name or git switch branch_name.

    • Return to the previous branch using git checkout -.


Standard GitHub Commands

  1. git clone

    • Downloads a copy of a repository from GitHub to your local machine.
  2. git remote add origin

    • Associates your local repository with a remote repository on GitHub called origin.
  3. git push origin main

    • Sends your local commits to the main branch on the origin remote repository (your GitHub repository).
  4. git pull origin main

    • Fetches and integrates the latest changes from the main branch of the origin remote repository (your GitHub repository) into your local repository.
  5. git branch

    • Lists all the branches in your repository and shows the current branch.
  6. git branch

    • Creates a new branch called <branch-name>.
  7. git checkout

    • Switches to the branch called <branch-name>.
  8. git merge

    • Merges the branch called <branch-name> into the current branch.
  9. git branch -d

    • Deletes the branch called <branch-name>.

Reflection on the Week's Learning Experience

This week has been immensely productive and insightful. Diving into Linux process management, package management, networking concepts, and Git fundamentals has significantly enhanced my understanding of system administration and version control. Each challenge encountered provided a valuable learning opportunity, reinforcing my technical skills and problem-solving abilities.

https://github.com/Parthasarathy-G/Linux-fundamendals

https://github.com/Parthasarathy-G/Git-and-GitHUB

https://github.com/Parthasarathy-G/Networking_concepts