linux Flashcards

1
Q

What is Linux Kernel?

A

The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user. It is also used to provide an interface for user-level interaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Linux?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between UNIX and LINUX?

A

Unix originally began as a propriety operating system from Bell Laboratories, which later on spawned into different commercial versions. On the other hand, Linux is free, open source and intended as a non-propriety operating system for the masses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is BASH?

A

BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the original Bourne Shell (represented by /bin/sh). It combines all the features from the original version of Bourne Shell, plus additional functions to make it easier and more convenient to use. It has since been adapted as the default shell for most systems running Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is LILO?

A

LILO is a boot loader for Linux. It is used mainly to load the Linux operating system into main memory so that it can begin its operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a swap space?

A

Swap space is a certain amount of space used by Linux to temporarily hold some programs that are running concurrently. This happens when RAM does not have enough memory to hold all programs that are executing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the advantage of open source?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the basic components of Linux?

A

Just like any other typical operating system, Linux has all of these components: kernel, shells and GUIs, system utilities, and an application program. What makes Linux advantageous over other operating system is that every aspect comes with additional features and all codes for these are downloadable for free.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Does it help for a Linux system to have multiple desktop environments installed?

A

In general, one desktop environment, like KDE or Gnome, is good enough to operate without issues. It’s all a matter of preference for the user, although the system allows switching from one environment to another. Some programs will work in one environment and not work on the other, so it could also be considered a factor in selecting which environment to use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the basic difference between BASH and DOS?

A

The key differences between the BASH and DOS console lie in 3 areas:

– BASH commands are case sensitive while DOS commands are not;

– Under BASH, / character is a directory separator and \ acts as an escape character. Under DOS, / serves as a command argument delimiter and \ is the directory separator

– DOS follows a convention in naming files, which is 8 character file name followed by a dot and 3 characters for the extension. BASH follows no such convention.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the importance of the GNU project?

A

This so-called Free software movement allows several advantages, such as the freedom to run programs for any purpose and freedom to study and modify a program to your needs. It also allows you to redistribute copies of software to other people, as well as the freedom to improve software and have it released for the public.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe the root account.

A

The root account is like a systems administrator account and allows you full control of the system. Here you can create and maintain user accounts, assigning different permissions for each account. It is the default account every time you install Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is CLI?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is GUI?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you open a command prompt when issuing a command?

A

To open the default shell (which is where the command prompt can be found), press Ctrl-Alt-F1. This will provide a command line interface (CLI) from which you can run commands as needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you find out how much memory Linux is using?

A

From a command shell, use the “concatenate” command: cat /proc/meminfo for memory usage information. You should see a line starting something like Mem: 64655360, etc. This is the total memory Linux thinks it has available to use.

free - m

vmstat

top

htop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a typical size for a swap partition under a Linux system?

A

The preferred size for a swap partition is twice the amount of physical memory available on the system. If this is not possible, then the minimum size should be the same as the amount of memory installed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are symbolic links?

A

Symbolic links act similarly to shortcuts in Windows. Such links point to programs, files or directories. It also allows you instant access to it without having to go directly to the entire pathname.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Does the Ctrl+Alt+Del key combination work on Linux?

A

Yes, it does. Just like Windows, you can use this key combination to perform a system restart. One difference is that you won’t be getting any confirmation message and therefore, a reboot is immediate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you refer to the parallel port where devices such as printers are connected?

A

Whereas under Windows you refer to the parallel port as the LPT port, under Linux you refer to it as /dev/lp . LPT1, LPT2 and LPT3 would therefore be referred to as /dev/lp0, /dev/lp1, or /dev/lp2 under Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Are drives such as hard drive and floppy drives represented with drive letters?

A

No. In Linux, each drive and device have different designations. For example, floppy drives are referred to as /dev/fd0 and /dev/fd1. IDE/EIDE hard drives are referred to as /dev/hda, /dev/hdb, /dev/hdc, and so forth.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do you change permissions under Linux?

A

Assuming you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or – symbol to deny permission, along with any of the following letters: u (user), g (group), o (others), a (all), r (read), w (write) and x (execute). For example, the command chmod go+rw FILE1.TXT grants read and write access to the file FILE1.TXT, which is assigned to groups and others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

In Linux, what names are assigned to the different serial ports?

A

Serial ports are identified as /dev/ttyS0 to /dev/ttyS7. These are the equivalent names of COM1 to COM8 in Windows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How do you access partitions under Linux?

A

Linux assigns numbers at the end of the drive identifier. For example, if the first IDE hard drive had three primary partitions, they would be named/numbered, /dev/hda1, /dev/hda2 and /dev/hda3.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are hard links?

A

Hard links point directly to the physical file on disk, and not on the pathname. This means that if you rename or move the original file, the link will not break since the link is for the file itself, not the path where the file is located.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the maximum length for a filename under Linux?

A

Any filename can have a maximum of 255 characters. This limit does not include the path name, so therefore the entire pathname and filename could well exceed 255 characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are filenames that are preceded by a dot?

A

In general, filenames that are preceded by a dot are hidden files. These files can be configuration files that hold important data or setup info. Setting these files as hidden makes it less likely to be accidentally deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Explain virtual desktop.

A

This serves as an alternative to minimizing and maximizing different windows on the current desktop. Using virtual desktops can clear the desktop when you can open one or more programs. Rather than minimizing/restoring all those programs as needed, you can simply shuffle between virtual desktops with programs intact in each one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

How do you share a program across different virtual desktops under Linux?

A

To share a program across different virtual desktops, in the upper left-hand corner of a program window look for an icon that looks like a pushpin. Pressing this button will “pin” that application in place, making it appear in all virtual desktops, in the same position onscreen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What does a nameless (empty) directory represent?

A

This empty directory name serves as the nameless base of the Linux file system. This serves as an attachment for all other directories, files, drives, and devices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the pwd command?

A

The pwd command is short for print working directory command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What are daemons?

A

Daemons are services that provide several functions that may not be available under the base operating system. Its main task is to listen for service request and at the same time to act on these requests. After the service is done, it is then disconnected and waits for further requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How do you switch from one desktop environment to another, such as switching from KDE to Gnome?

A

Assuming you have these two environments installed, just log out from the graphical interface. Then at the login screen, type your login ID and password and choose which session type you wish to load. This choice will remain your default until you change it to something else.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What are the kinds of permissions under Linux?

A

There are 3 kinds of permissions under Linux:- Read: users may read the files or list the directory- Write: users may write to the file of new files to the directory- Execute: users may run the file or lookup a specific file within a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

How does case sensitivity affect the way you use commands?

A

When we talk about case sensitivity, commands are considered identical only if every character is encoded as is, including lowercase and uppercase letters. This means that CD, cd, and Cd are three different commands. Entering a command using uppercase letters, where it should be in lowercase, will produce different outputs.

36
Q

What are environmental variables?

A

Environmental variables are global settings that control the shell’s function as well as that of other Linux programs. Another common term for environmental variables is global shell variables.

37
Q

What are the different modes when using vi editor?

A

There are 3 modes under vi:- Command mode – this is the mode where you start in- Edit mode – this is the mode that allows you to do text editing- Ex mode – this is the mode wherein you interact with vi with instructions to process a file

38
Q

Is it possible to use shortcuts for a long pathname?

A

Yes, there is. A feature known as filename expansion allows you do this using the TAB key. For example, if you have a path named /home/iceman/assignments directory, you would type as follows: /ho[tab]/ice[tab]/assi[tab] . This, however, assumes that the path is unique and that the shell you’re using supports this feature.

39
Q

What is redirection?

A

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.

40
Q

What is grep command?

A

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.

41
Q

What could be the problem when a command that was issued gave a different result from the last time it was used?

A

One highly possible reason for getting different results from what seems to be the same command has something to do with case sensitivity issues. Since Linux is case sensitive, a command that was previously used might have been entered in a different format from the present one. For example, to lists all files in the directory, you should type the command ls, and not LS. Typing LS will either result in an error message if there is no program by that exact name exist or may produce a different output if there is a program named LS that performs another function.

42
Q

What are the contents of /usr/local?

A

It contains locally installed files. This directory matters in environments where files are stored on the network. Specifically, locally-installed files go to /usr/local/bin, /usr/local/lib, etc.). Another application of this directory is that it is used for software packages installed from source, or software not officially shipped with the distribution.

43
Q

How do you terminate an ongoing process?

A

Every process in the system is identified by a unique process id or pid. Use the kill command followed by the pid to terminate that process. To terminate all process at once, use kill 0.

44
Q

How do you insert comments in the command line prompt?

A

Comments are created by typing the # symbol before the actual comment text. This tells the shell to completely ignore what follows. For example “# This is just a comment that the shell will ignore.”

45
Q

What is command grouping and how does it work?

A

You can use parentheses to group commands. For example, if you want to send the current date and time along with the contents of a file named OUTPUT to a second file named MYDATES, you can apply command grouping as follows: (date cat OUTPUT) > MYDATES

46
Q

How do you execute more than one command or program from a single command line entry?

A

You can combine several commands by separating each command or program using a semicolon symbol. For example, you can issue such a series of commands in a single entry:

47
Q

Write a command that will look for files with an extension “c”, and has the occurrence of the string “apple” in it.

A

Find ./ -name “*.c” | xargs grep –i “apple”

48
Q

Write a command that will display all .txt files, including its individual permission.

A

ls -al *.txt

49
Q

Write a command that will do the following:

  • look for all files in the current and subsequent directories with an extension c,v
  • strip the,v from the result (you can use sed command)
  • use the result and use a grep command to search for all occurrences of the word ORANGE in the files.
A

Find ./ -name “*.c,v” | sed ‘s/,v//g’ | xargs grep “ORANGE”

50
Q

What is the command to calculate the size of a folder?

A

To calculate the size of a folder uses the command du –sh folder1.

51
Q

How can you find the status of a process?

A

ps ux

52
Q

How can you check the memory status?

A

free -m to display output in MB

free -g to display output in GB

53
Q

Explain how to color the Git console?

A

To color the Git console, you can use the command git config—global color.ui auto. In the command, the color.ui variable sets the default value for a variable such as color.diff and color.grep.

54
Q

How can you append one file to another in Linux?

A

cat file2&raquo_space; file 1

55
Q

Explain how to enable curl on Ubuntu LAMP stack?

A

To enable curl on Ubuntu, first, install libcurl, once done use following command sudo/etc/init .d /apache2 restart or sudo service apache2 restart.

56
Q

How can you run a Linux program in the background simultaneously when you start your Linux Server?

A

By using nohup. It will stop the process receiving the NOHUP signal and thus terminating it you log out of the program which was invoked with. & runs the process in the background.

57
Q

Explain how to uninstall the libraries in Linux?

A

sudo apt-get remove library_name

58
Q

What is Kubernetes?

A

Kubernetes is an open-source container orchestration tool or system that is used to automate tasks such as the management, monitoring, scaling, and deployment of containerized applications.

59
Q

What are K8s?

A

K8s is another term for Kubernetes.

60
Q

What is orchestration when it comes to software and DevOps?

A

refers to the integration of multiple services that allows them to automate processes or synchronize information in a timely fashion.

61
Q

How are Kubernetes and Docker related?

A

Docker is an open-source platform used to handle software development. main benefit is that it packages the settings and dependencies that the software/application needs to run into a container, which allows for portability and several other advantages. Kubernetes allows for the manual linking and orchestration of several containers, running on multiple hosts that have been created using Docker.

62
Q

main differences between the Docker Swarm and Kubernetes?

A
  • Docker Swarm is more convenient to set up but doesn’t have a robust cluster, while Kubernetes is more complicated to set up but the benefit of having the assurance of a robust cluster
  • Docker Swarm can’t do auto-scaling (as can Kubernetes); however, Docker scaling is five times faster than Kubernetes
  • Docker Swarm does automatic load balancing of traffic between containers in a cluster, while Kubernetes requires manual intervention for load balancing such traffic
63
Q

What are the main components of Kubernetes architecture?

A

master node and the worker node. Each of these components has individual components in them.

64
Q

What is a node in Kubernetes?

A

smallest fundamental unit of computing hardware. It represents a single machine in a cluster, which could be a physical machine in a data center or a virtual machine from a cloud provider.

65
Q

What does the node status contain?

A

main components of a node status are Address, Condition, Capacity, and Info.

66
Q

What process runs on Kubernetes Master Node?

A

The Kube-api server process runs on the master node and serves to scale the deployment of more instances.

67
Q

What is a pod in Kubernetes?

A

Pods are high-level structures that wrap one or more containers. This is because containers are not run directly in Kubernetes. Containers in the same pod share a local network and the same resources, allowing them to easily communicate with other containers in the same pod as if they were on the same machine while at the same time maintaining a degree of isolation.

68
Q

What is the job of the kube-scheduler?

A

The kube-scheduler assigns nodes to newly created pods.

69
Q

What is a cluster of containers in Kubernetes?

A

set of machine elements that are nodes. Clusters initiate specific routes so that the containers running on the nodes can communicate with each other.

70
Q

What is the Google Container Engine?

A

open-source management platform tailor-made for Docker containers and clusters to provide support for the clusters that run in Google public cloud services.

71
Q

What are Daemon sets?

A

Daemon set is a set of pods that runs only once on a host. They are used for host layer attributes like a network or for monitoring a network, which you may not need to run on a host more than once.

72
Q

What is ‘Heapster’ in Kubernetes?

A

A Heapster is a performance monitoring and metrics collection system for data collected by the Kublet. This aggregator is natively supported and runs like any other pod within a Kubernetes cluster, which allows it to discover and query usage data from all nodes within the cluster.

73
Q

What is a Namespace in Kubernetes?

A

Namespaces are used for dividing cluster resources between multiple users.

74
Q

Name the initial namespaces from which Kubernetes starts?

A

Default
Kube – system
Kube – public

75
Q

What is the Kubernetes controller manager?

A

The controller manager is a daemon that is used for embedding core control loops, garbage collection, and Namespace creation. It enables the running of multiple processes on the master node even though they are compiled to run as a single process.

76
Q

What are the types of controller managers?

A

The primary controller managers that can run on the master node are the endpoints controller, service accounts controller, namespace controller, node controller, token controller, and replication controller.

77
Q

What is etcd?

A

key-value store for all of its data, including metadata and configuration data, and allows nodes in Kubernetes clusters to read and write data

78
Q

What are the different services within Kubernetes?

A

Cluster IP service
Node Port service
External Name Creation service and
Load Balancer service

79
Q

What is ClusterIP?

A

The ClusterIP is the default Kubernetes service that provides a service inside a cluster (with no external access) that other apps inside your cluster can access.

80
Q

What is NodePort?

A

The NodePort service is the most fundamental way to get external traffic directly to your service. It opens a specific port on all Nodes and forwards any traffic sent to this port to the service

81
Q

What is the LoadBalancer in Kubernetes?

A

The LoadBalancer service is used to expose services to the internet. A Network load balancer, for example, creates a single IP address that forwards all traffic to your service.

82
Q

What is a headless service?

A

A headless service is used to interface with service discovery mechanisms without being tied to a ClusterIP, therefore allowing you to directly reach pods without having to access them through a proxy. It is useful when neither load balancing nor a single Service IP is required.

83
Q

What is Kubelet?

A

The kubelet is a service agent that controls and maintains a set of pods by watching for pod specs through the Kubernetes API server. It preserves the pod lifecycle by ensuring that a given set of containers are all running as they should. The kubelet runs on each node and enables the communication between the master and slave nodes.

84
Q

What is Kubectl?

A

Kubectl is a CLI (command-line interface) that is used to run commands against Kubernetes clusters. As such, it controls the Kubernetes cluster manager through different create and manage commands on the Kubernetes component

85
Q

Give examples of recommended security measures for Kubernetes.

A

defining resource quotas, support for auditing, restriction of etcd access, regular security updates to the environment, network segmentation, definition of strict resource policies, continuous scanning for security vulnerabilities, and using images from authorized repositories.

86
Q

What is Kube-proxy?

A

implementation of a load balancer and network proxy used to support service abstraction with other networking operations.

87
Q

How can you get a static IP for a Kubernetes load balancer?

A

changing DNS records since the Kubernetes Master can assign a new static IP address.