Day 2 Task: Basics linux commands

What is Linux?

Linux is an operating system, just like Windows, iOS, and Mac OS. In fact, one of the most popular platforms on the planet, Android, is powered by the Linux operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. To put it simply, the operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn’t function.

Architecture of Linux

Hardware layer: Linux operating system contains a hardware layer that consists of all peripheral devices like RAM/HDD/CPU.

Kernel layer: Linux operating system contains a kernel Layer. A Kernel is the core component of any Linux based operating system. It is responsible for each of the major actions of the Linux OS. It virtualizes the common hardware resources of the computer to provide each process with its virtual resources. This makes the process seem as if it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes. There are some of the important kernel types which are mentioned below:

· Monolithic Kernel

· Hybrid kernels

· Exo kernels

· Micro kernels

Shell layer: Shell is an interface among the kernel and user which hides the complexity of the kernel’s functions from the users. It takes commands from the user and executes the kernel’s functions. These operating systems are categorized into two different types, which are the graphical shells and command-line shells.

The graphical line shells facilitate the graphical user interface, while the command line shells facilitate the command line interface. Thus, both of these shells implement operations. However, the graphical user interface shells work slower as compared to the command-line interface shells.

There are some types of these shells which are mentioned below:

· Korn shell

· Bourne shell

· C shell

· POSIX shell

System Library: In these libraries there are a special type of functions that are applied for implementing the operating system’s functionality

System Utility: It provides the functionalities of an operating system to the user. Some instances would have been the commands that allow users to share and modify files and folders, generate data as well as do jobs such as backup files.

Three types of users

· Super User — Its username is root. root can access all directories in an OS.

· Normal Users — Normal users can access only limited directories.

· System Users — Users created automatically at the time of Operating system installation or at the time of software installation. It will be a non-login user.

Basics Linux commands

· pwd — Print Working Directory, It will show the path of the current working directory.

· man — Used to display the user manual of any command that we can run on the terminal.

· clear — Clear the terminal screen.

· history — Displays a list of commands used in the terminal session.

Listing Commands

· ls — List the Directories and files available in the respective directory.

Options/flag in ls command
· ls -l = It will show the list in a long list format.
· ls -al = Enlist the whole list of the current directory including the hidden files in list format.
· ls-lh = This command will show you the file sizes in human readable format. The (ls -lh) command will give you the data in terms of Mb, Gb, Tb, etc.
· ls-d*/ = It is used to display only subdirectories
· ls ~ = It gives the contents of home directory.

Command for Directories

· cd — Change of directory

options/ flag in cd command
· cd .. = change directory to on step back
· cd - = Go to last working directory
· cd ~ = Change directory to home directory
· cd../.. = Change directory to 2 levels back.

· mkdir — Make new directory

options/ flag in mkdir command

• mkdir .NewFolder   = make a hidden directory (also . before a file to make it hidden)
• mkdir A B C D      = make multiple directories at the same time
• mkdir -p, -parents = Add directory including its sub directory.
• mkdir -p A/B/C/D   = Add directory in a nested directory
• mkdir -v, -verbose = Print a message for each created directory.
• mkdir -m -mode     =Mode Set access privilege.

· rmdir — Remove empty directories.

Thank you for reading..!

"Embark on the Journey of Knowledge: Happy Learning Lights Up Your Path."

_Abhi Sagare.