Slide 1

Slide 1 text

Linux 101 Insights from the OS that runs the world (Literally)

Slide 2

Slide 2 text

After the session, we shall be Clear about: 1. What is Linux ? 2. Where is Linux Used ? 3. What is Kernel 4. Windows vs Linux 5. And lots of hands on :) Slides will be shared later, but not our way of delivering it :)

Slide 3

Slide 3 text

What is Linux? Just like Windows and MacOS, Linux is an operating system (OS) Technically, Linux -> Kernel (Low-level OS) | GNU/Linux -> Linux kernel + GNU Software collection (Libre software) | Linux Distribution -> Linux kernel + GNU Software collection + Desktop environment and additional software Hence a Linux distribution is a complete OS

Slide 4

Slide 4 text

Where is Linux used?

Slide 5

Slide 5 text

Where is Linux used?

Slide 6

Slide 6 text

Where is Linux used?

Slide 7

Slide 7 text

Where is Linux used?

Slide 8

Slide 8 text

Where is Linux used?

Slide 9

Slide 9 text

Where is Linux used?

Slide 10

Slide 10 text

Linux vs Windows Linux Windows ● Open-source ● Free ● Relatively more secure ● Transparent ● Respects privacy ● Contribute ○ Documentation ○ Features ○ Bug Fixes ● Available in source code and binary ● Closed-source ● Paid ● Relatively less secure ● No transparency ● ● Cannot contribute directly apart from reporting bugs ● Available in only binary ● Often known as BSOD *_*

Slide 11

Slide 11 text

Linux vs Windows Linux Windows You can control what is updated and EVEN STOP ALL UPDATES!!!

Slide 12

Slide 12 text

What is CLI? ● CLI stands for command line interface ● Terminal in Linux whereas Command Prompt/Powershell in Windows Terminal - The Force of Linux ● An interface to give commands to the OS, more often referred to as a terminal emulator. It allows us to interact with the shell. ● Types - gnome-terminal, konsole, xterm, rxvt, kvt, nxterm, and eterm So, what is a shell? ● The shell is a program that takes commands from the keyboard and gives them to the OS to perform. ● Types - bash(most common), ksh, tcsh, zsh

Slide 13

Slide 13 text

Gentle Introduction to the Linux shell Shell basically is a communication interface between you and the OS. In UNIX-based systems there are two types of shells : 1. Bourne shell (which we will be exploring). 2. The C shell. Bourne shell also has various subcategories like : ● Korn shell (ksh) ● Bourne shell (sh) ● Bourne-again shell (bash) ---- Most common, available by default on most systems ● Z shell (zsh) ---- This one looks beautiful when customized!

Slide 14

Slide 14 text

Gentle Introduction to the Linux shell Commands Overview ● Basics & Navigation ● File Manipulation ● System commands ● Network commands ● Searching, Piping and Redirection ● Hardware Info ● Users and Permissions ● Install packages and Other utilities

Slide 15

Slide 15 text

Basics and Navigation 1. pwd -> pwd (print working directory) shows the current directory (basically, the folder) you’re in 2. cd -> The most basic command of all time, cd (change directory) means change directory 3. ls -> ls (list) list down all the content inside the directory 4. Flags -> A flag is anything prefixed with a dash (-) or double dash (--) that follows the command name 5. tree -> Visualize a directory in a tree structure 6. clear / reset / Ctrl + L -> Typing clear or reset or input any of the key combinations mentioned will get your terminal clean and wiped up 7. man -> If see a new command you’ve never heard of or happen to forget, use man to find out 8. sudo command -> sudo (superuser do) is used to execute commands with admin privileges

Slide 16

Slide 16 text

File Manipulation 1. ./filename -> Execute a locally stored file 2. mkdir -> mkdir (make directory) is used to create a directory 3. mv -> To move files, the command mv (move) is used 4. rm -> rm (remove) removes files, CAUTION: cannot be undone 5. touch -> To create new (empty) files, use touch 6. cp -> To copy a file from one place to another or to make a copy of the file in same directory 7. echo -> echo prints out whatever you say to it 8. Displaying contents of a file -> cat, head, tail 9. tar/unzip -> Used to work with archives and compressed files

Slide 17

Slide 17 text

System commands 1. uname -a -> Displays basic system information such as OS, Kernel, architecture etc. 2. hostname -> Displays the system host name (system name) 3. whoami -> Displays who you are logged in as (user name) 4. date -> Displays current system date and time 5. cal -> Displays the current month and day 6. uptime -> Displays how long your system has been running with load average

Slide 18

Slide 18 text

1. ip a -> Displays information about all network interfaces 2. ping -> ping commands sends a request to a host to establish a connection 3. host -> Performs IP lookup on the domain name 4. whois -> Retrieves more information about a domain 5. wget -> wget (World Wide Web Get) is a very powerful utility to download files from an online service 6. netstat -> Netstat displays various network related information such as network connections, routing tables, interface statistics etc. 7. netcat -> Often referred to as a Swiss army knife of networking tools, this command can assist you in monitoring, testing, and sending data across network connections Network commands

Slide 19

Slide 19 text

1. grep -> Read as "apply the print command on all lines matching the given regular expression". Extremely powerful tool to search for content in files 2. locate -> locate is used to find all instances of a file 3. find -> find is a more aggressive search tool than locate with more options and features 4. | (Pipe) -> It redirects the output of the LHS command to the input of RHS command Syntax: command1 | command2 | command3 5. Redirections -> Similar to pipe, but instead of passing output to another command, they save the o/p to a file or read contents from a file Types -> 1. > 2. < 3. >> 4. << Searching, Piping and Redirection

Slide 20

Slide 20 text

1. dmesg -> Displays bootup messages, useful to troubleshoot device boot errors 2. lsblk -> Displays block device related information, ex: hard disk, flash drives etc. 3. lsusb -> Displays a list of attached USB devices 4. inxi -> Prints whole lot of information about the hardware, including vendor details, device driver configuration etc, in a readable format 5. fdisk -> Shows disk partition, sizes, and types 6. du -> Displays disk usage in current directory 7. mount -> Mounts a device at specified location 8. umount -> Unmount a mounted device Hardware

Slide 21

Slide 21 text

1. id -> Displays the active user's info 2. last -> Shows the last logins 3. Permissions ● Types of permission - read (r), write (w), and execute (x) ● Arrangement - - --- --- --- dir/file user group others 4. chmod -> chmod (change mode) is used to change permissions of files and directories 5. chown -> chown (change owner) is used to change ownership of a file or directory Users and Permissions

Slide 22

Slide 22 text

1. apt-get -> Default package manager for Debian based systems such as Ubuntu 2. dpkg -> Used to install, remove and provide info about .deb packages Other utilities 1. history -> Shows the complete history of your terminal commands 2. alias -> Set up custom aliases for various commands 3. htop -> System monitor (explicit install) 4. neofetch -> Shows the system info in a beautiful format (explicit install) Install Packages and Other Utilities

Slide 23

Slide 23 text

Time to VIM it :)

Slide 24

Slide 24 text

Open Files vim Eg: To start editing press ‘i’: To exit edit mode, press ‘Esc’ key

Slide 25

Slide 25 text

Editing Files Pressed ‘i’ Pressed ‘Esc’

Slide 26

Slide 26 text

Exit vim ( with and without Save) While in view mode (out of insert mode) ● To exit: Press ‘:’ then ‘q’ (stands for quit vim) ● To save: Press ‘:’ then ‘w’ (stands for write file) ● To save & exit: Press ‘:’ then ‘wq’ (stands for write then quit) Notice ‘wq’ NOT ‘qw’

Slide 27

Slide 27 text

Relax and Hydrate :) ☕🧉🍸🍵

Slide 28

Slide 28 text

It’s Time to play with Linux!

Slide 29

Slide 29 text

Challenge #1 ● Clone react by git clone https://github.com/facebook/react ● Find and navigate to react-client ● Find src directory by listing and navigate into it ● Show current directory path ● Using relative paths, find and navigate to react-server/src

Slide 30

Slide 30 text

Challenge #2 ● Make this directory structure using mkdir one-liner ● Make an empty file in child1 and subchild2 ● Copy the file in subchild2 to child3 with a different name ● Move the file in subchild2 to subchild4 with a different name ● Remove the child2 directory

Slide 31

Slide 31 text

Challenge #3 ● Navigate to the react directory ● In README.md file, find the lines containing the word Taylor ● Save the output of above command in a file taylor.txt using piping and redirection ● Append this file with a line “Lines found”

Slide 32

Slide 32 text

Challenge #4 ● Make a bash script by name hello.sh ● Place just one echo command in it with your favourite text ● Give all permissions to the user and group, and only read permission to others ● Execute the file

Slide 33

Slide 33 text

Linux can be made the way you love it

Slide 34

Slide 34 text

Or the way you want it to be ;P

Slide 35

Slide 35 text

Or the way you want it to be ;P This desktop belongs to Arpan, our beloved Speaker of the day :)

Slide 36

Slide 36 text

Z shell (zsh) In Beauty Mode How to make Terminal less Spooky

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Tools and steps to look for 1. Install zsh or z-shell and make it as default shell. 2. For customizing terminal to fullest, you need zsh framework, for ex. Oh-my-zsh.(you can install this framework using this guide - https://github.com/ohmyzsh/ohmyzsh) 3. After installing framework, you can use plugins to customize terminal, like if you want to change theme, you can use powerlevel10k. And if you face problem while using it, they made it easy to uninstall like an easy breakup

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Awesome Resources ● Beautiful website to learn step by step - https://linuxjourney.com/ ● Awesome Linux - https://github.com/inputsh/awesome-linux ● The Complete Linux Course - https://www.youtube.com/watch?v=wBp0Rb-ZJak ● Linux commands cheat sheet - https://linoxide.com/guide/linux-cheat-sheet.png ● Good place to learn shell scripting - https://linuxcommand.org/ ● Another worthwhile resource - https://github.com/learnbyexample/Linux_command_line ● Getting Started with Git and Github - https://anmoldeep1509.medium.com/first-steps-to-git-and-github-fda904959256

Slide 41

Slide 41 text

Thank you to these folks for making this session possible 😊 Arpan Adlakhiya Linkedin Pushkar Kukde Linkedin Devanshu Vaidya - Linkedin Anmoldeep Singh Arora Linkedin