LINUX BASIC
1) What is Linux?
Linux is an operating system based on UNIX and was first introduced by Linus
Torvalds. It is based on the Linux Kernel and can run on different hardware
platforms manufactured by Intel, MIPS, HP, IBM, SPARC, and Motorola. Another popular
element in Linux is its mascot, a penguin figure named Tux.
2)
Ø
Linux system are extremely stable.
Ø
Linux is free.
Ø
No threat of viruses.
Ø
Linux comes with most of the required software pre-installed.
Ø
Linux never get slow.
Ø
Linux does not need defragmentation.
Ø
Linux can even run on oldest hardware.
Ø
Linux is open source.
3) Why we use LINUX?
Ans: LINUX is used widely because it is completely different from other operating systems where every aspect comes with something extra i.e. some additional features. Some of the major reasons to use LINUX are listed below
- It is an open source operating system where programmers get the advantage of designing their own custom OS
- Software and the server licensing required to install Linux is completely free and can be installed on many computers as required
- It has low or minimum but controllable issues with viruses, malware, etc
- It is highly secured and supports multiple file systems
4) What is the difference between UNIX and LINUX?
Although there are multiple differences between LINUX and UNIX, enlisted below table covers all the major differences.
LINUX |
UNIX |
LINUX is an open source software development and free operating system used for computer hardware & software, game development, PCs, etc. |
UNIX is an operating system which is basically used in Intel, HP, internet servers, etc. |
LINUX has priced as well as freely distributed and downloaded versions. |
Different versions/flavours of UNIX have different price structures. |
Users of this operating system could be anyone including home users, developers, etc. |
This operating system was basically developed for mainframes, servers and workstations except for OSX which is designed such that it can be used by anyone. |
File support system includes Ext2, Ext3, Ext4, Jfs, Xfs, Btrfs, FAT, etc. |
File support system includes jfs, gpfs, hfs, etc. |
BASH (Bourne Again Shell) is the Linux default shell i.e. text mode interface which supports multiple command interpreters. |
Bourne shell serves as the text mode interface which is now compatible with many others including BASH. |
LINUX provides two GUIs, KDE and Gnome. |
Common desktop environment was created which serves as a GUI for UNIX. |
Examples: Red Hat, Fedora, Ubuntu, Debian, etc. |
Examples: Solaris, All Linux |
It provides higher security and has about 60-100 viruses listed till date. |
It is also highly secured and has about 85-120 viruses listed till date. |
5) What is the difference between LINUX and WINDOWS?
ser |
WINDOWS |
LINUX |
1 |
Not open source (paid one) |
Open source (Free Download & use all features) |
2 |
Less security |
High security |
3 |
Pay for ms office |
free software |
4 |
It is User Friendly |
But Linux is not user friendly |
5 |
Linus first developed by Linus Trovalds |
Windows OS was developed by Microsoft |
6) What is the advantage of open source?
Open source allows you to distribute your software, including source codes
freely to anyone who is interested. People would then be able to add features
and even debug and correct errors that are in the source code. They can even
make it run better and then redistribute these enhanced source code freely
again. This eventually benefits everyone in the community.
7) Write down the linux file system (tree).
9) What is linux distro? Write down some name of different distro.
Ans: A Linux distribution (often abbreviated as distro) is an operating system made from a software collection, which is based upon the Linux kernel and, often, a package management system. ... The software is usually adapted to the distribution and then packaged into software packages by the distribution's maintainers.
a. Red
Hat (Commercial) and Enterprise Support
b. Fedora
c. CentOS
d. Ubuntu
e. Debian
f. Mint
g. BackTrack
h. Kali Linux
i. Slackware
j. Oracle Linux
k. Open SUSE
l. Mandrake
m. Scientific Linux
n. Open BSD
o. Free BSD
p. Android (Linux Kernel)
10) Write down the booting process of linux.
11) Explain the 3 kinds of file permissions under LINUX?
Ans: Every file and directory in Linux are assigned three
types of owners namely ‘User’, ‘Group’, and ‘Others’. Find the three kinds of
permissions defined for all the three owners
- Read: This permission allows you to open and read the file as well as list the contents of the directory.
- Write: This permission allows you to modify the contents of the file as well as allows adding, removing and renaming files stored in the directories.
- Execute: User can access and run the file in the directory. You cannot run a file unless the execute permission is set.
12) What is CLI?
CLI is short for Command Line Interface. This interface allows the user to
type declarative commands to instruct the computer to perform operations. CLI
offers greater flexibility. However, other users who are already accustomed to
using GUI find it difficult to remember commands including attributes that come
with it.
13) What is GUI?
GUI, or Graphical User Interface, make use of images and icons that users
click and manipulate as a way of communicating with the computer. Instead of
having to remember and type commands, the use of graphical elements makes it
easier to interact with the system, as well as adding more attraction through
images, icons, and colors.
14) What is redirection?
Redirection is the process of directing data from one output to another. It
can also be used to direct an output as an input to another process.
There are basically three streams available in which input and output of Linux environment are distributed.
These are explained as below
- Input Redirection: ‘<’ symbol is used for input redirection and is numbered as (0). Thus it is denoted as STDIN(0).
- Output Redirection: ‘>’ symbol is used for output redirection and is numbered as (1). Thus it is denoted as STDOUT(1).
- Error Redirection: It is denoted as STDERR(2).
15) Explain the Linux ‘cd’ command options along with the description?
Ans: ‘cd’ stands for change directory and is used to change the current directory on which user is working.
cd syntax : $ cd {directory}
Following purposes can be served with ‘cd’ commands
- Change from current to a new directory
- Change directory using the absolute path
- Change directory using the relative path
Few of the ‘cd’ options are enlisted below
- cd ~: Brings you to the home directory
- cd -: Brings you to the previous directory
- cd .: Bring you to the parent directory
- cd /: Takes you to the entire system’s root directory
16) What is grep command?
grep a search command that makes use of pattern-based searching. It makes
use of options and parameters that are specified along with the command line
and applies this pattern in searching the required file output.
17) Write a command that will look for files with an extension "c", and has the occurrence of the string "apple" in it.
Answer:
Find ./ -name "*.c" | xargs grep –i "apple"
18) Write a command that will display all .txt files, including its individual permission.
Answer:
ls -al *.txt
19) What is the command to calculate the size of a folder?
To calculate the size of a folder uses the command du –sh folder1.
20) What is
the main fields of /etc/passwd file?
1. Username: It is used when user logs in. It should be between 1 and 32
characters in length.
2. Password: An x character indicates that encrypted password is stored
in /etc/shadow file.
3. User ID (UID): Each user must be assigned a user ID (UID). UID 0
(zero) is reserved for root and UIDs 1-99 are reserved for other predefined
accounts. Further UID 100-999 are reserved by system for administrative and
system accounts/groups.
4. Group ID (GID): The primary group ID (stored in /etc/group file)
5. User ID Info: The comment field. It allow you to add extra
information about the users such as user's full name, phone number etc. This
field use by finger command.
6. Home directory: The absolute path to the directory the user will be
in when they log in. If this directory does not exists then users directory
becomes /
7. Command/shell: The absolute path of a command or shell (/bin/bash).
Typically, this is a shell.
21) What is path in linux? How many type of path?
Ans: Path: A path is a unique
location to a file or a folder in a file system of an OS.A path to a file is a
combination of / and alpha-numeric characters.
There are two type of path. Those are
a. Absolute Path:
An absolute path is defined as specifying the location of a file or
directory from the root directory(/). In other words,we can say that an
absolute path is a complete path from start of actual file system from /
directory.
b. Relative path:
Relative path is defined as the path related to the present working
directly(pwd). It starts at your current directory and never starts
with a / .
22) Enlist some Linux networking and troubleshooting commands?
Ans: Every computer is connected to network internally or externally for the purpose of exchanging information. Network troubleshooting and configuration are essential parts of and network administration. The networking commands enable you to quickly troubleshoot connection issues with another system, check the response of another host, etc.
Network administrator maintains system network which includes network configuration and troubleshooting. Mentioned below are few commands along with their description:
Mentioned below are few commands along with their description
- Hostname: To view the hostname (domain and IP address) of the machine and to set the hostname.
- Ping: To check if the remote server is reachable or not.
- ifconfig: To display and manipulate route and network interfaces. It displays network configuration. ‘ip’ is the replacement of ifconfig command.
- netstat: It displays network connections, routing tables, interface statistics. ‘ss’ is the replacement of netstat command which is used to get more information.
- Traceroute: It is network troubleshooting utility which is used to find the number of hops required for a particular packet to reach the destination.
- Tracepath: It is same as traceroute with a difference that it does not require root privileges.
- Dig: This command is used to query the DNS name servers for any task related to DNS lookup.
- nslookup: To find DNS related query.
- Route: It shows the details of the route table and manipulates IP routing table.
- mtr: This command combines ping and track path into a single command.
- Ifplugstatus: This command tells us whether the network cable is plugged in or not.
23. WHAT IS AN OPERATING SYSTEM?
➤
An
provides common services for computer programs. All computer
programs, excluding firmware, require an operating system to function.
No comments