Linux Flashcards

1
Q

What is Unix? Linux? How are Linux OS’s different from other OS’s?

A

Linux refers to the kernel of the GNU/Linux operating system. More generally, it refers to the family of derived distributions. Unix refers to the original operating system developed by AT&T. More generally, it refers to family of derived operating systems.

Linux is an open source operating system whereas Windows OS is commercial. Linux has access to source code and alters the code as per user need whereas Windows does not have access to the source code. In Linux, the user has access to the source code of the kernel and alter the code according to his need.

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

List some Linux distributions

A

Ubuntu
Kali Linux
RedHat Linux
Kubuntu
Fedora
Mageia
Mint

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

Explain the terms terminal, shell, console, command-line?

A

A physical terminal is referred to as a console. The shell is a command-line interpreter. A command line, also known as a command prompt, is a type of interface.

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

What is the bash shell? How would you write a bash script?

A

Stands for Born Again Shell that is a complete implementation of the IEEE POSIX.2 and Open Group Shell specification

  1. Create a new file, hello.sh and open it with nano.
  2. On the first line specify the interpreter to be used in the code. In this case it is Bash.
  3. On a new line use echo to print a string of text to the screen.
  4. Save the code by pressing CTRL + X, then press Y and Enter.
  5. Run the code from the terminal.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the shebang syntax and purpose?

A

The shebang is a special character sequence in a script file that specifies which program should be called to run the script.

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

What is an environment variable and how would you set one?

A

An environment variable is a variable whose value is set outside the program, typically through functionality built into the operating system or microservice.

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

What is the difference between relative and absolute paths?

A

An absolute path is a complete path from start of actual file system from / directory. Relative path is defined as the path related to the present working directly(pwd).

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

Where are the root and home directories located?

A

By default, all non-root user home directories are located in a directory named “home”, below the / (root) directory - in the path of /home.

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

What Linux command would you use to:
Search for text in a text file

A

Grep

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

What Linux command would you use to:
Navigate your file hierarchy on the command line?

A

cd

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

What Linux command would you use to:
List files? What about hidden files? See permissions for the files?

A

ls :list files
ls -a :list files and hidden files
ls -la :list files and permissions

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

What Linux command would you use to:
Change the permissions of a file

A

chmod

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

What Linux command would you use to:
Edit a file from the terminal

A

nano or vi

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

How do file permissions work on a Linux system?

A

In the world of Linux, permissions are broken down into three categories: read, write and execute.

“Read” access allows one to view a file’s contents,
“write” access allows one to modify a file’s contents,
“execute” allows one to run a set of instructions, like a script or a program.

Each of these categories are applied to different classes: user, group, and world. “User” means the owner, “group” means any user who is in the same group as the owner, and “world” means anybody and everybody.

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

What is a package manager? What are some common Linux package managers?

A

A package manager is a tool that allows users to install, remove, upgrade, configure and manage software packages on an operating system. The package manager can be a graphical application like a software center or a command line tool like apt-get or pacman.

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

What does “I/O redirection” mean?

A

nput/Output (I/O) redirection in Linux refers to the ability of the Linux operating system that allows us to change the standard input ( stdin ) and standard output ( stdout ) when executing a command on the terminal.

17
Q

You run a command but get an error message saying you don’t have enough permissions. What could you try to resolve this?

A

Use the chmod command and use the permission number 777 to allow everything.