What is Linux?
Linux is an open-source operating system, by using that users or applications can communicate with the hardware components with the help of a kernel.
Linux is based on Unix and an operating system kernel first released on September 17, 1991, by Linus Torvalds.
Flavours of Linux
Ubuntu
Debian
CentOS
Fedora
Redhat
Linux Architecture
Hardware: It is physical hardware that includes items such as Mouse, Keyboard, Display, CPU etc.,
Kernel: It is the core component of the Linux Operating System. It is responsible to execute our commands and interact with hardware components. Its main function Memory Managemen, Process Management, Device Management, Storage Management etc.,
Shell: It is the outer layer of the Linux operating system. It acts as an interface between the user and the kernel. Shell will read commands which we have typed. It will check whether the command is proper or not. It also checks syntax. If the command is valid then it will interpret that command into kernel understandable form and handover it over to the kernel.
There are a few types of these shells which are categorized as follows:
Korn shell
Bourne shell
C shell
POSIX shell
Application: This is the topmost layer of the Linux architecture.It consists of the various applications that run on the operating system. These can be anything from text editors, software and games to web browsers and media players.
Command Execution Flow
Linux Filesystem
/bin: bin contains binary executables related to commands used by a normal user.
/sbin: It contains all binary executables related to high-end admin (superuser OR root) commands. Eg: Disk partitioning, network management etc.bin contains binary executables related to commands used by a superuser.
/etc: This directory contains all system configuration files.
/tmp: It contains all temporary files.
/dev: It contains device node files.
/mnt: Mount point for temporarily mounting a filesystem.
/media: Mount point for removable media devices.
/opt: opt means optionally. This directory contains all third-party software installation files.
/lib: lib means library. It contains Linux os libraries which are required by our commands and applications.
/var: var means variable data. It stores log files.
/home: It stores each user's data. data can be images, files etc.,
/proc: It stores data related to currently running processes.
/root: It is the home directory of the superuser.
/boot: This directory contains the files which are required to boot linux os.
/user: user means user. This directory contains all user-related software.
Linux Basic Commands
1. How to check your present working directory?
Go to the Linux terminal and type pwd command.
2. How to list files and directories in Linux?
type ls in the Linux terminal.
Syntax: ls <options>
ls -l command will show long listing files.
ls -a will show hidden files.
ls -la this command will show all the files and directories along with hidden files and in a long listing format.
- How to create a directory in Linux? (In windows we called it a folder)
mkdir command is used to create a directory in Linux.
Syntax: mkdir <directory name>
here I have created a testing directory.
We can create a directory within a directory by using the below command:
mkdir -p A/B/C/D/E
-p means the path of directories.
How to remove empty directories in Linux?
Use rmdir <empty directory name>
I have created a testing empty directory. To remove the testing directory we need to type: rmdir testing
if the directory is not empty then we should use the rm command with the -r option. it will remove all content that is available within the directory.rm command works for files and directories.
In the next blog, we will discuss in detail more commands.
Thank you.