Introduction to Linux & the Command Line Flashcards

1
Q

What is the history of Linux? Who created it?

A

Created by Linus Torvalds
1991
Student in Finland

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

So who combines GNU with Linux?

A
Red Hat
Canonical
Debian
Slackware
Linux Family Tree (https://distrowatch.com/dwres.php?resource=family-tree)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which distributions should we be familiar with for the exam?

A

CentOS

Ubuntu

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

How do we access the command line interface?

A
Boot direct to console
Terminal software:
 XTERM
Konsole
Gnome Terminal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Is the CLI the same on all Linux distros?

A
/bin/sh
     -Generally links to another shell
Red Hat / CentOS
     -/bin/bash
Ubuntu
    -/bin/dash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do we execute commands in the CLI?

A
Typing them into the terminal.
*Single commands
ls
history
*Options/Arguments
uname
uname -a
shutdown -h now
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some common commands we may use?

A
ls
mkdir
cd
pwd
echo
touch
cp
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can we edit files from within the CLI?

A

YES

  • View
    • cat
    • more
    • less
  • Edit
    • vim
    • nano
    • gedit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Are there any other tips or tricks for the CLI?

A

Tab auto-complete

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

When do we need super user privileges?

A

System-wide changes
Changes that affect other users
Configuring some services

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

What is the easiest way to access super user privileges?

A
*su
   Substitute user
*su -
  Switch to root
   - loads normal environment
*su - (username)
   Switch to user

Function: Change user ID or become superuser

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

What if I just want to perform a single command?

A

*sudo
Executes command as root
Password cached for five minutes by default

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

Who is allowed to use the sudo command?

A

Administrators
*Users must be authorized to run sudo
In some distros (like Ubuntu) simply add ‘sudo’ group as a
secondary group
In others (like Red Hat) you must create your own group and
add it to /etc/sudoers

visudo =
dpezet ALL=(ALL)

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

What command allows users to securely edit files?

A
  • sudoedit
    • Useful when editing a single write-protected file
    • sudoedit /etc/hosts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does bash stand for?

A

Bourne Again Shell

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

What is the ls command?

A

ls = list

Function: List information about the files (the current directory by default)

17
Q

What is the history command?

A

Displays a list of commands previously used in the terminal session.
history allows users to reuse any listed command without retyping it.

18
Q

What is the uname command?

A

The uname command is used to print basic system information. It is usually invoked with the -a option to display all available information.

19
Q

What is the mkdir command?

A

The mkdir command in Linux/Unix allows users to create or make new directories.

20
Q

What is the cd command?

A

The cd (“change directory”) command is used to change the current working directory in Linux and other Unix-like operating systems.

21
Q

What is the pwd command?

A

pwd stands for Print Working Directory. It prints the path of the working directory, starting from the root.

22
Q

What is the echo command?

A

echo command in linux is used to display a line of text/string that is passed as an argument .

23
Q

What is the touch command?

A

The touch command’s primary function is to modify a timestamp. Commonly, the utility is used for file creation, although this is not its primary function.

24
Q

What is the cp command?

A

The Linux cp command is used for copying files and directories to another location.

25
Q

What is the cat command?

A

The cat (short for “concatenate“) command is one of the most frequently used commands in Linux/Unix-like operating systems. cat command allows us to create single or multiple files, view content of a file, concatenate files and redirect output in terminal or files.

26
Q

What is the more command?

A

more command is used to view the text files in the command prompt, displaying one screen at a time in case the file is large (For example log files).

27
Q

What is the less command?

A

The less command is a Linux terminal pager that shows a file’s contents one screen at a time. It is useful when dealing with a large text file because it doesn’t load the entire file but accesses it page by page, resulting in fast loading speeds.

28
Q

What is the vim command?

A

Vim is a text editor that is an upgraded version of the Vi editor and is more compatible with Vi. The most usage of vi editors is to create a new file, edit an existing file, or just read a file.

29
Q

What is the nano command?

A

GNU nano is a simple terminal-based text editor. Though not as powerful as Emacs or Vim, it is easy to learn and use. Nano is ideal for making small changes to existing configuration files or for writing short plain text files.

30
Q

What is the gedit command?

A

gedit is the official text editor of the GNOME desktop environment.
While aiming at simplicity and ease of use, gedit is a powerful general purpose text editor. It can be used to create and edit all kinds of text files.

31
Q

What is the su command?

A

The su command is used to switch to another user, in other words change user ID during a normal login session (that is why it is sometimes referred to as switch (-) user by a number of Linux users).

32
Q

What is the sudo command?

A

sudo , which is an acronym for superuser do or substitute user do, is a command that runs an elevated prompt (permissions) without a need to change your identity.

33
Q

What is the visudo command?

A

The visudo command opens a text editor like normal, but it validates the syntax of the file upon saving. This prevents configuration errors from blocking sudo operations, which may be your only way of obtaining root privileges.

34
Q

What is the sudoedit command?

A

Sudoedit is a built-in command that allows users to securely edit files. According to the sudo man page, ‘sudoedit’ is equivalent to executing ‘sudo’ with the ‘-e’ command line option.