Linux 2 Flashcards

1
Q

What command lists files and directories in the current directory?

A

ls

This command is fundamental for viewing the contents of a directory.

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

What does the command ‘ls -l’ do?

A

Lists files with detailed info (permissions, owner, size, date)

This provides a more comprehensive view of files than ‘ls’.

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

What command lists all files, including hidden files?

A

ls -a

Hidden files are those starting with a dot (.) in Unix-like systems.

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

What is the function of the ‘cd’ command?

A

Changes the current working directory

This command is essential for navigation in the file system.

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

What does ‘pwd’ stand for and what does it do?

A

Prints the current working directory path

Useful for confirming your current location in the file system.

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

What command is used to create a new directory?

A

mkdir

This command allows users to organize files into folders.

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

What does the ‘rm’ command do?

A

Deletes a file

Use with caution as it permanently removes files.

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

What does ‘rm -r’ do?

A

Deletes a directory and its contents recursively

This command is powerful and can lead to data loss if misused.

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

What is the function of the ‘mv’ command?

A

Moves or renames files and directories

This command can be used to organize files effectively.

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

What command is used to copy files and directories?

A

cp

This is essential for backing up files or duplicating content.

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

What does the ‘cat’ command do?

A

Displays file contents or joins multiple files

Useful for quickly viewing text files.

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

What is ‘nano’?

A

A simple, user-friendly command-line text editor

Ideal for beginners who need to edit files.

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

What are ‘vim’ and ‘vi’?

A

Powerful command-line text editors with modes and shortcuts

They have a steeper learning curve but offer extensive features.

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

What does ‘chmod’ do?

A

Changes file or directory permissions

Important for controlling access to files.

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

What is the purpose of ‘chown’?

A

Changes the ownership of a file or directory

This is crucial for managing user permissions.

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

What does ‘sudo’ do?

A

Runs a command as the superuser (admin privileges)

Necessary for performing administrative tasks.

17
Q

What is the function of ‘su’?

A

Switches to another user account (often root)

This command is used for changing user contexts.

18
Q

What does ‘grep’ do?

A

Searches text using basic regular expressions

It is a powerful tool for finding specific patterns in files.

19
Q

What does ‘fgrep’ or ‘grep -F’ do?

A

Searches for fixed strings (no regex interpretation)

Useful for exact string matches.

20
Q

What is ‘egrep’ or ‘grep -E’ used for?

A

Searches using extended regular expressions

It allows for more complex search patterns.

21
Q

What does ‘grep -f’ do?

A

Searches for patterns from a file

This allows for batch searching of multiple patterns.

22
Q

What is the purpose of ‘grep -e’?

A

Allows specifying multiple patterns directly in the command

This enhances the flexibility of the search.

23
Q

What does the ‘man’ command do?

A

Shows the manual page for a command

This is crucial for understanding command functionalities.

24
Q

What does ‘man grep’ display?

A

The manual page specifically for grep

Useful for learning about grep’s options and usage.

25
Q

What does ‘df -h’ show?

A

Shows disk space usage in human-readable format

Essential for monitoring available storage.

26
Q

What does ‘du -sh’ do?

A

Shows the size of a directory and its contents

Useful for understanding space usage by specific directories.

27
Q

What command displays network interface configuration?

A

ifconfig / ip

‘ip’ is preferred on modern systems.

28
Q

What does the ‘history’ command do?

A

Displays a list of previously entered commands

Useful for recalling past commands and reusing them.

29
Q

What is the Linux Directory Layout?

A

The structure of folders like /home, /etc, /bin, /var, /usr, etc.

Understanding this layout is key for navigating Linux systems.

30
Q

What commands are used for Linux Directory Navigation?

A

Using commands like cd, pwd, ls

These commands facilitate moving through the file system.

31
Q

What is the Least Privilege Principle?

A

Users should have only the minimum level of access needed to perform their tasks

This principle is essential for security.

32
Q

What are Linux Distributions?

A

Different flavors of Linux (e.g., Ubuntu, CentOS, Fedora, Debian) built on the Linux kernel but with different tools, package managers, and goals

Each distribution caters to different user needs and environments.