Linux Questions with Answers

Linux Questions with Answers

What is Linux?

Linux is an open-source Unix-like operating system-based family on the Linux kernel, and the OS kernel was first published on 17 September 1991 by Linus Torvalds.

Differences between Unix and Linux?

Differences between Windows & UNIX

Architecture of Linux

An OS is made up of 2 components, known as,

a) Shell

b) Kernel

The kernel is the core of an OS which manages the entire system resources The shell acts as an interface between kernel and end user or application.

What is a Processes?

A process in Linux is nothing but a program in execution. It’s a running instance of a program. Any command that you execute starts a process.

Types of Processes in Linux

In Linux processes can be of two types:

  • Foreground Processes
    depend on the user for input
    also referred to as interactive processes

  • Background Processes
    run independently of the user
    referred to as non-interactive or automatic processes

Process States in Linux

A process in Linux can go through different states after it’s created and before it’s terminated. These states are:

  • Running

  • Sleeping

    • Interruptible sleep

    • Uninterruptible sleep

  • Stopped

  • Zombie

  • A process in running state means that it is running or it’s ready to run.

  • The process is in a sleeping state when it is waiting for a resource to be available.

  • A process in Interruptible sleep will wakeup to handle signals, whereas a process in Uninterruptible sleep will not.

  • A process enters a stopped state when it receives a stop signal.

  • Zombie state is when a process is dead but the entry for the process is still present in the table.

There are two commands available in Linux to track running processes.

Top

To track the running processes on our machine we can use the top command.

$ top

Ps

ps command is short for ‘Process Status’. It displays the currently-running processes.

$ ps

Stop a Process

To stop a process in Linux, use the 'kill’ command.

$ kill -L

  1. In Linux, a soft link, also known as a symbolic link, is a special sort of file that points at a different file.

  2. soft links can point at entire directories or link to files on remote computers.

  1. A hard link is a mirror copy of the original file.

  2. The distinguishing characteristic of a hard link from a soft link is that deleting the original file doesn't affect a hard link, while it renders a soft link inoperable.