• Animesh Gupta

Here’s what you need to know about Linux

Linux is like air — you don’t feel it or know it even exists, but you need it all the same. From your addicting Android smartphones and all the apps you love in it, to Air traffic control stations and even the Large Hadron Collider, everything runs on Linux. For those who didn’t know, Linux is an open source operating system based on UNIX. We’ll go into the technical details later in this post.

1. What is Linux?

Linux is an open source operating system based on UNIX. The operating system is the system software that manages computer hardware and software. Suppose you want to perform 25597 / 10, the OS is the one which facilitates this input to be performed by the computer processor(hardware) and displayed to the monitor screen(software). Open source means, some good people did all the work in developing the software and released the source code for free. You can add your own features and even debug the source code.

Linux comes in various flavors /distributions such as— Fedora, Ubuntu, OpenSUSE which are commercial, while Debian and Arch Linux is entirely community driven. All these have the Linux kernel in them. Linux appeals to programmers due to its versatility, power, speed and the package manager which lets them install software seamlessly.

2. What is the kernel?

The kernel is the heart of the operating system. Linux Kernel is a low-level system software. It provides an interface for user-level interaction. It manages the system resources such as RAM, Disk, Processor, output devices etc.

3. What is the shell in Linux?

Linux shell is basically a user interface. You can enter your inputs into the shell, The shell would execute the commands and communicate with the Linux OS in doing so. There are varieties here too — BASH (Bourne Again SHell), CSH ( C Shell), KSH ( Korn Shell) and TCSH.

4. What is Bash?

BASH is a short form of Bourne Again SHell. It is also a command language and has its own command syntax.

5. What are file permissions in Linux?

There are 3 types of permissions in Linux OS that are given below:

  • Read: User can read the file and list the directory.

  • Write: User can write new files in the directory or modify the file.

  • Execute: User can access and run the file in a directory.

Directory here is similar to a folder in Windows. The chmod and chown commands are used to control access to files in UNIX and Linux systems. The chmod command stands for “change mode”, and allows changing permissions of files and folders in Linux. The chown command stands for “change owner” .

With the chmod , User U, Groups G, and Others O can be granted varying permissions such as Read, Write or Execute to files and directories. Read has a value of 4, Write of 2, Execute of 1 . Add the values of required permissions and assign it in the corresponding position for UGO.

6. What is sudo?

It stands for “super user do!” .If you add “sudo” before any Linux command, it will run that command with elevated privileges. So you could now perform certain admin tasks such as the installation of servers or reboot.

7. What happens when you give ‘ sudo rm -rf * ’?

It is the code that deletes everything on the computer. rm means to remove, -rf flag deletes entire folder forcefully. * stands for every file/folder on Linux system.

8. What are Editors in Linux?

A text editor is a must have application for any operating system (for plain text, writing code). Linux editors can be divided into two categories,

* GUI editors — They are graphical and user-friendly . Eg- Gedit and Sublime. * Console text editors. — They work right inside the terminal and are.But they are difficult for beginners. Eg- Nano, Vi, Vim.

9. What commands do you use in Linux filesystem?

  • pwd: It is a built-in command which stands for ‘print working directory’. It displays the full path to the directory you are currently in.

  • Is: This command list out all the files in the current folder.

  • cd: This stands for ‘change directory’. This command is used to change to the directory you want to work from the present directory.

  • mkdir: This command is used to create an entirely new directory.

  • rmdir: This command is used to remove a directory from the system.

10. What are some Linux file content commands?

  • head: Displays the beginning of the file

  • tail: Displays the last part of the file

  • cat: Concatenate files and print on the standard output ( the terminal).

  • more: Displays the content in page form — one page at a time.

  • less: Displays the content in page form and allows backward and single line movement.

11. What is Cron?

The software utility cron is a time-based job scheduler. Cron schedules jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. You could set it to download a movie every Friday evening (Write a script to download the latest movie and assign it to cron).

12. What is LVM?

LVM, or Logical Volume Management, is a storage device management technology. It gives users the power to pool and abstract the physical layout of component storage devices such as hard disks and external drives for easier and flexible administration.

13. What is CLI?

CLI (Command Line Interface) is a text-based interface in Linux which lets users interact with the OS and applications. It is unlike the GUI(Graphical User Interface) in Microsoft which has graphical icons, links, and folders. CLI allows a user to perform tasks by entering commands manually. Its working mechanism is very easy and fast, but it is not user-friendly.

14. What is LILO?

LILO (Linux Loader) is the boot loader for Linux operating system to load it into the main memory so that it can begin its operations. Bootloader here is a small program that manages a dual boot. LILO resides in MBR (Master Boot Record).

15. What are the Grep, Awk and Sed commands?

Grep, awk, and Sed are three of the most useful command-line tools.

  • Grep (Global Regular Expression Print) is used to search for specific terms in a file. Eg. to find all the lines in your project report having the word ‘result’.

  • Awk is a text pattern scanning and processing language. It is mostly used for data extraction and reporting in Excel files. Eg, To print certain columns of an excel sheet only.

  • Sed refers to Stream Editor. It can perform text transformations on a given file or an input stream. Eg, You shared an assignment from your friend. To replace all instances of his name with yours, use Sed.

16. How to find help on Linux?

  • Run the command with the -h or –help flags. For example to know about ls, type ls -help.

  • The man command shows detailed manuals for each command. These are referred to as “man pages.” If you want to know about ls command, type man ls.

Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program .

- Linus Torvalds, creator of Linux


©2019 Security Unleashed | New Delhi