If you are looking to learn Ubuntu , one of the most easiest distributions of Linux to work as a beginner or experienced professional, you have come to the right place.
In this tutorial you will learn about Ubuntu an Operating System and all the practical demonstrations that will allow you to get in-depth understanding. Lets gets started.
Table of Content
- What is Ubuntu?
- 32 bit or 64-bit Ubuntu?
- How does Ubuntu or Linux OS Boots?
- Ubuntu Software Management
- Basic Ubuntu Command Line Introduction
- Linux file system
- Important Linux/Ubuntu Directories and Files
What is Ubuntu?
Ubuntu is an Operating system and one of the easiest Linux distribution. Ubuntu runs well on variety of hardware. Ubuntu also contains some of its own flavors such as kubuntu, Xubuntu, Mythbuntu etc.
32 bit or 64 bit ubuntu?
A computer with 32 bit of memory can use max unto
4GB memory which is very less and computer with 64 bit can use way more than 4 GB . The reason is quite simple more memory address will allow you to store more data in RAM and that helps in processing of data much faster i.e. reading and writing data in disk or any other storage device. There are two types of processors that are majorly used i.e. Intel and AMD’s (use as per compatibility)
How does Ubuntu or Linux OS Boots?
Lets learn how to run or power on your Linux or Ubuntu Operating system.
- First machine is powered on and then it gets its first instruction from the ROM memory which further calls BIOS ( Basic INPUT AND OUTPUT SYSTEM) .
- BIOS performs POST i.e. ( POWER ON SELF TEST)
- When POST successfully completes the testing of hardware then BIOS check for MBR ( Master Boot Record) in hard disk for booting. MBR is mostly located in
/dev/hdaand the size of MBR is less than 512 bytes.
- There are 3 main types of boot loader: LILO, GRUB and GRUB2 .
- GRUB2 is the latest and primary boot-loader in Linux distributions.
- GRUB loads the kernel into main memory.
- Kernel works as a interface between Hardware and the software. It controls all the processes.
- After Kernel is loaded by GRUB it self extracts the compressed version and mounts with temporary File System i.e. initrd root file system until kernel is mounted with ROOT File System.
- Finally Kernel Initialize /sbin/init program ( which is legacy Process) or Kernel Initialize systemd program ( Latest)
- Users login into the machine.
Ubuntu Software Management
Lets talk about Software management of Ubuntu. There play vital role in installing or working with any application you want to install in ubuntu.
There are different ways to install Software’s and one of them is with Debian’s APT (
Advanced Package Tool) command. APT automatically finds the dependencies and downloads package for you , which is the coolest part of APT.
- Location of all the repositories that exists locally on machine.
- To update the version and package information on local machines by using
sudo apt update
- To upgrade specific package use
updatecommand followed by
sudo apt update sudo apt install apache2
- To upgrade all the commands in one go use
sudo apt upgrade # upgrade is not recommended
- To install mysql-server software on ubuntu machine.
sudo apt-get install mysql-server
- To remove mysql-server software use
sudo apt-get remove mysql-server
- To completely remove mysql-server software use
sudo apt-get purge mysql-server
- APT maintains a package cache where it stores deb files.
- To delete your cached Debian files use
apt-get clean or apt-get autoclean
- To search your cached Debian package run
apt-cache search kde
- To check details of specific package use
sudo apt show package_name
- To Install deb package manually using
sudo dpkg -i ubuntu_package.deb
- To install package using
snapcommand. snaps are packages that are built using Ubuntu core. Ubuntu core contains minimum number of files that are required to install package to protect from security or dependent packages from breaking.
snap find search-term snap list sudo snap install package-name snap list
Basic Ubuntu Command Line Introduction
Linux Command line is one of the powerful tools for admins. It is also known as Terminal, Shell, Command-line interfaces ( CLI ). Commands are an easier way to reach a specific path on Linux using CLI and also useful for the execution of multiple files or software. It is important to know about various commands that help you throughout your IT Career.
Let’s begin !
logoutTo logout from the command line
sshx.x.x.x To securely connect to an instance
info manTo Get detailed information about the
aproprosSimilar to the man command
whereisTo find a command and its documentation
dmesg> dmesg.txt Reads the messages generated by Kernel
ai.txt ai_back.txt– Copies data of a file to another file. Always create backup of files stored.
Linux file system
|/||The Root Directory||boot, dev , etc , home|
|/bin||Contains essential commands and they are statically linked that means they don’t require any shared libraries like /usr/lib or /lib which other directories requires.||bash, mount , login , ping|
|/boot||Linux Kernel and boot loader files||system.map, initrd.img-5.4.0-1029-aws , grub|
|/dev||Device files||autofs, null , disk, xvda , random|
|/etc||System configuration files||apt , crontab ,grub.d , kernel , python3, mysql, passwd, resolv.conf, systemd , ssl , gshadow , sudoers, fstab|
|/home||User home directory||ubuntu , jenkins|
|/lib||Shared libraries, kernel modules||systemd , 5.4.0-1035-aws|
|/media||Mount point for removable media|
|/mnt||Remote file system , Mount for local|
|/opt||Add on software packages|
|/proc||Kernel information, process control||cgroups , kernels , uptime , cpuinfo|
|/sbin||System command (For Root) and |
Contains essential commands and they are statically linked that means they don’t require any shared libraries like /usr/lib or /lib which other directories requires.
|blkid , init , vgextend , mkswap , lvm , ip , bridge , fdisk|
|/srv||Information regarding services on the system|
|/sys||Real time info on devices used by kernel||block , bus , firmware , hypervisor , kernel , module , power|
Important Linux/Ubuntu Directories and Files
- /etc: This directory contains system configuration files and software packages
- /etc/passwd: This file holds list of users
- /etc/sudoers : This file contains users and usersgroup with super user access.
- /etc/modprobe.d: This folder holds all the instructions to load kernel modules that are required as part of system startup.
- /etc/fstab : The file system table is a text file that lists each hard drive, CD-ROM, floppy, or other storage device attached to your PC.
- /proc : This directory is created at runtime from memory and exist only while Linux is running. It contains special files that either extract information from or send information to the kernel.
- /proc/version: Gives you kernel version.
- /proc/meminfo: To see memory information of the system and is equivalent to free command.
- /proc/net/route: To view the networking information
- /proc/uptime: To view the system uptime information
- /usr : This directory contains software applications, libraries and other type of shared data.
- /usr/share/man: Contains manual page
- /usr/share/doc: sofware package documentation
- /usr/share/name_of_package: Software package shared file