Linux Flashcards
What is Unix? Linux? How are Linux OS’s different from other OS’s?
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.
List some Linux distributions
Ubuntu
Kali Linux
RedHat Linux
Kubuntu
Fedora
Mageia
Mint
Explain the terms terminal, shell, console, command-line?
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.
What is the bash shell? How would you write a bash script?
Stands for Born Again Shell that is a complete implementation of the IEEE POSIX.2 and Open Group Shell specification
- Create a new file, hello.sh and open it with nano.
- On the first line specify the interpreter to be used in the code. In this case it is Bash.
- On a new line use echo to print a string of text to the screen.
- Save the code by pressing CTRL + X, then press Y and Enter.
- Run the code from the terminal.
What is the shebang syntax and purpose?
The shebang is a special character sequence in a script file that specifies which program should be called to run the script.
What is an environment variable and how would you set one?
An environment variable is a variable whose value is set outside the program, typically through functionality built into the operating system or microservice.
What is the difference between relative and absolute paths?
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).
Where are the root and home directories located?
By default, all non-root user home directories are located in a directory named “home”, below the / (root) directory - in the path of /home.
What Linux command would you use to:
Search for text in a text file
Grep
What Linux command would you use to:
Navigate your file hierarchy on the command line?
cd
What Linux command would you use to:
List files? What about hidden files? See permissions for the files?
ls :list files
ls -a :list files and hidden files
ls -la :list files and permissions
What Linux command would you use to:
Change the permissions of a file
chmod
What Linux command would you use to:
Edit a file from the terminal
nano or vi
How do file permissions work on a Linux system?
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.
What is a package manager? What are some common Linux package managers?
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.