All About Linux

What is Linux?

Linux is a free open-source operating system that manages a computer's hardware and resources,like memory,storage and cpu.

Why linux?

It is a free,open source and secure platform with flexibility,customization and fast compared with other os.

What is Linux Boot process?

The Linux boot process has 6 levels:

BIOS: Basic input output system

-Perform integrity checks

-Search,load and execute the boot load program from cd-rom,hard drive,floppy

-In simple terms, the BIOS loads and executes the Master Boot Record (MBR) boot loader

MBR: Master boot record

-Located in first sector of bootable disk /dev/hda or /dev/sda

-It has 3 components 1.primary boot loader 2.partition table 3.mbr validation check

-It is responsible for loading and executing the GRUB boot loader.

GRUB:Grand Unified Bootloader executes kernel-It has multiple kernel images on your system

-Knowledge about file system

-Grub configuration file is /boot/grub/grub.conf

Kernel:Core of the operating system.

-Mounts root file system and executes /sbin/init program

-As it is the first program executed by kernel,its process id is 1

-initrd(initial RAM disk) is a used as a temporary root file system until kernel is booted.

Init:Looks at the /etc/inittab file to decide the Linux run level.

-0 – halt,1 – Single user mode, 2 – Multiuser, without NFS ,3 – Full multiuser mode , 4 – unused ,5 – X11 , 6 – reboot

Runlevel: When the Linux system is booting up, you might see various services getting started, depending on your default init level setting.

-Programs start with S are used during startup and K for shutdown.

Top 50 linux Commands:

  1. ls-Displays list of files or directories

  2. pwd-print current working directory

  3. cd-change directory ,cd ..-change directory to previous,cd ~-change directory to home

  4. mkdir-create a new directory

  5. mv-move or rename files

  6. cp-copy a file

  7. rm-remove file or directory

  8. touch-creates a blank file

  9. clear-clear the display

  10. cat-Display the content of the file

  11. ln - Create symbolic links (shortcuts) to other files

  12. echo - Print any text that follows the command

  13. less - Display paged outputs in the terminal

  14. man - Access manual pages

  15. uname - Gets basic information about the OS

  16. whoami - Get the active username

  17. tar - Command to extract and compress files in linux

  18. grep - Search for a string within an output

  19. head - Return the specified number of lines from the top

  20. tail - Return the specified number of lines from the bottom

  21. diff - Find the difference between two files

  22. cmp - Allows you to check if two files are identical

  23. comm - Combines the functionality of diff and cmp

  24. sort - sort the content of a file while outputting

  25. export - Export environment variables

  26. zip - Zip files in Linux

  27. unzip - Unzip files in Linux

  28. ssh - Secure Shell command in Linux

  29. service - Linux command to start and stop services

  30. ps - Display active processes

  31. kill and killall - Kill active processes by process ID or name

  32. df - Display disk filesystem information

  33. mount - Mount file systems in Linux

  34. chmod -change file permissions,4-read,2-write,1-execute

  35. chown - granting ownership of files or folders

  36. ifconfig - Display network interfaces and IP addresses

  37. traceroute - Trace all the network hops to reach the destination

  38. wget - Direct download files from the internet

  39. ufw - Firewall command

  40. iptables - Base firewall for all other firewall utilities to interface with

  41. apt, pacman, yum, rpm - Package managers depending on the distribution

  42. sudo - Command to escalate privileges in Linux

  43. cal - View a command-line calendar

  44. alias - Create custom shortcuts for your regularly used commands

  45. dd - Majorly used for creating bootable USB sticks

  46. whereis - Locate the binary, source, and manual pages for a command

  47. whatis - Find what a command is used for

  48. top - View active processes live with their system usage

  49. useradd and usermod - Add a new user or change existing user data

  50. passwd - Create or update passwords for existing users

Linux File System: