GX2 Finding Your Way on a Linux System Flashcards

1
Q

Topic 2.1: Command Line Basics

What is Bash?

A

Bash (Bourne Again Shell) is a command-line interpreter that allows users to interact with the Linux operating system.

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

Topic 2.1: Command Line Basics

What does the echo command do?

A

The echo command prints text or variables to the terminal. Example: echo “Hello, Linux!”

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

Topic 2.1: Command Line Basics

How can you view previously entered commands in the terminal?

A

Use the history command to display a list of previously executed commands.

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

Topic 2.1: Command Line Basics

What is the purpose of the PATH environment variable?

A

The PATH variable defines directories where the system looks for executable programs.

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

Topic 2.1: Command Line Basics

How do you set or modify an environment variable?

A

Use the export command. Example: export MYVAR=”Hello”

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

Topic 2.1: Command Line Basics

How do you check the type of a command or utility?

A

Use the type command. Example: type ls tells you if ls is a built-in or external command.

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

Topic 2.2: Using the Command Line to Get Help

How do you access the manual (man) page for a command?

A

Use the man command followed by the command name. Example: man ls

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

Topic 2.2: Using the Command Line to Get Help

What is the difference between man and info pages?

A

man pages provide concise documentation, while info pages offer more detailed, structured documentation.

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

Topic 2.2: Using the Command Line to Get Help

Where can you find additional documentation on installed programs?

A

In the /usr/share/doc/ directory.

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

Topic 2.2: Using the Command Line to Get Help

How do you locate a file or command on the system?

A

Use the locate command. Example: locate bashrc

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

Topic 2.3: Using Directories and Listing Files

How do you list files in a directory?

A

Use the ls command. Example: ls -l for a detailed list.

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

Topic 2.3: Using Directories and Listing Files

How do you show hidden files in a directory?

A

Use ls -a. Hidden files start with a dot (.).

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

Topic 2.3: Using Directories and Listing Files

What is the difference between absolute and relative paths?

A

Absolute path: Full path from root (e.g., /home/user/file.txt).

Relative path: Path from the current directory (e.g., ../file.txt).

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

Topic 2.3: Using Directories and Listing Files

What do . and .. represent in a directory?

A

. represents the current directory.

.. represents the parent directory.

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

Topic 2.3: Using Directories and Listing Files

What does cd ~ do?

A

It navigates to the home directory of the current user.

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

Topic 2.4: Creating, Moving, and Deleting Files

How do you create an empty file?

A

Use the touch command. Example: touch myfile.txt

17
Q

Topic 2.4: Creating, Moving, and Deleting Files

How do you move or rename a file?

A

Use the mv command. Example: mv oldname.txt newname.txt

18
Q

Topic 2.4: Creating, Moving, and Deleting Files

How do you copy a file?

A

Use the cp command. Example: cp file.txt backup.txt

19
Q

Topic 2.4: Creating, Moving, and Deleting Files

How do you delete a file?

A

Use the rm command. Example: rm myfile.txt

20
Q

Topic 2.4: Creating, Moving, and Deleting Files

How do you create and remove directories?

A

Create: mkdir mydir

Remove: rmdir mydir (only works if empty)