Skip to main content

Command Palette

Search for a command to run...

Basic concepts of linux

Updated
5 min read
Basic concepts of linux

Day 1

Hello everyone!!!

Myself Swanik Santosh Gudekar. Today I attended my first session on the topic LINUX . This session was conducted by our alumnus Master Pranav Jambare. He is a DevOps engineer at TCS company. We all enjoyed and learn so many things from him.

POINTS COVERED IN THIS SESSION :

  • Operating System

  • History of Linux

  • Why to choose Linux?

  • Linux File Hierarchy

  • Basic Architecture

Operating System :

  • It manages the computer's memory and processes, as well as all its software and hardware.

  • It acts as an interface between the computer and the hardware

  • Eg. Apple MacOS, Windows,LInux OS.

History of Linux :

A popular open-source operating system is Linux. It was initially created by Linus Torvalds in 1991. At the time, Torvalds was a computer science student at the University of Helsinki, Finland and began working on the Linux project as a personal endeavor. The name Linux is a combination of his first name, Linus, and Unix, the operating system that inspired his projects. At the time, most operating systems were proprietary and expensive. Torvalds wanted to create an operating system that was freely available to anyone who wanted to use the operating system, He originally released Linux as free software under the GNU General Public License. This meant that anyone could use, modify, and redistribute his source code.

Early versions of Linux were primarily used by technology enthusiasts and software developers, but over time it has grown in popularity and is used in various types of devices such as servers, smartphones, and embedded systems. Linux is considered one of the most stable, secure and reliable operating systems and is widely used in servers, supercomputers and enterprise environments. Today, Linux is one of the most widely used operating systems in the world, with an estimated 2.76% of all desktop computers and more than 90% of the world’s top supercomputers running on Linux, and approx. 71.85% of all mobile devices run on Android, which is, you guessed it, Linux-based.

Why to choose Linux:

  • Free

  • Open Source

  • Software Updates

  • Security

  • Privacy

  • Customization

  • Perfect for programmers

  • Variety of distribution

  • Better community support

Linux file hierarchy :

  • / -Hierarchy starting comes under slash. Multiple directories are include under it

  • /bin/- It includes small binaries

  • /boot/- Configuration related to booting

  • /dev /- Dinformation

  • /etc/- Configuration file

  • /home/- Home directories of user

  • /lib/- To run binary library is used so it stores in library directives

  • /media/ -Used to store photos, videos

  • /mnt/- Used for temporary mounting.

  • /opt/- Optional things

  • /root/- It is an administrative user.

  • /sbin/- System binary.

  • /srv/- Server related.

  • /tmp/- Temprary file.

  • /usr/- User related file

  • /var/- Variable file

  • /chache/- Chache file

  • /log/ - Related to tracing

  • /spool/- Mail related information

  • /tmp/ - Temprary files

Linux Architecture :

  • Hardware layer : It is the bottom most layer of the Linux architecture. It contains Terminals,Printers,Disks,etc.

  • Kernal layer : It is the heart of the operation system. It act as a interpreter between shell layer and hardware layer.

  • Shell layer : It is the terminal used to run command.

  • Application layer : This is the top most layer of the architecture. It contains the application such as Notepad, VS code,VLC Media player,etc.

  • Utilities : It provides the functionality of the operating system to the user.

Yanking commands:

  • yy - Used to copy a line. Move the cursor to the line you want to copy and then press yy.

  • p - Paste a copied or cut line after the current line.

  • dd (cut) - Deletes current line completely.

  • cc – We can go into insert mode

  • gg – Used to go to the beginning of the file

  • G – Used to go to the last line of the file

  • :4 – Used to go to a specific line of the file

  • :! - If you want to run the command while you are within the file

  • :set nu – Used to set the line number onto the editor

  • :%s/word/otherword – Replace the word with other word and only the first occurrence of every line will get changed

  • :%s/word/otherword/g – Replace the word with other word and now all the occurrences will get changed

  • /word - To find a specific word in a file

Redirection Commands :

  • find/ -user<username> - Used to search for directories owned by a specific user.

  • find/ -user<username>2><errorfile> - With the addition of "2><errorfile> ", any error messages generated by the "find" command during the search process will be redirected to the specific "<errorfile>". This way, you can store the error messages separately while the regular output is displayed on the screen.

  • find/ -user<username><outputfile> - With the addition of "><outputfile> ", outputs generated by the "find" command during the search process will be redirected to the specific "<outputfile>". This way, you can store the outputs separately while only the errors will be displayed on the screen.

  • find/ -user<username><outputfile>2><errorfile> - "find" will search for directories owned by the specified user, and the output will be redirected to the "<outputfile>". Any errors generated during the search will be redirected to the "<errorfile>".

  • find/ -user<username>&>/dev/null - Both the regular output and any error messages generated during the search will be removed and not displayed or saved anywhere.

  • find/ -user<username>|tee<filename> - This command is used to search directories owned by a specific user and save the output to both the terminal and a file.

Modes :

  • Escape mode

  • Insert mode

  • Save and exit

  • Visual / Block

These were the topics covered by Master Pranav Jambare in the first session of Linux.

More from this blog

Swanik

9 posts