Linux Command Line Flashcards

1
Q

What is Linux?

A

An open-source operating system commonly used by researchers for servers and robotics

Linux allows users to access system resources safely and efficiently.

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

What are the common features of Linux?

A
  • Process Management
  • Interrupts
  • Memory Management
  • File System
  • Device Drivers
  • Networking (TCP/IP, UDP)
  • Security (Process/Memory Protection)
  • Input/Output (I/O)

These features help in managing system resources effectively.

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

What is the role of the kernel in Linux?

A

Controls the hardware and provides functions like handling interrupts, memory allocation, and CPU sharing

The kernel exposes basic services to higher-level programs via system calls.

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

What are system utilities in Linux?

A
  • File copy
  • Hard disk repair/defragmentation
  • Command line tools like ls, grep, sed

System utilities perform specific tasks that enhance system functionality.

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

What does a Linux distribution comprise?

A
  • Kernel
  • System Utilities
  • GUI (e.g., GNOME, KDE)
  • Application Programs

A distribution can vary in its components and package management.

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

What is the significance of the /boot directory?

A

Contains files required for the boot process except configuration files

Essential for starting the Linux operating system.

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

What types of files exist in Linux?

A
  • Ordinary File
  • Directories
  • Devices
  • Links (Hard Link, Soft Link)

Each type serves a specific purpose within the filesystem.

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

What is the basic directory structure in Linux?

A
  • /bin: Binary Files
  • /sbin: Super-user Binaries
  • /etc: Configuration files
  • /home: User home directories
  • /lib: Library files
  • /tmp: Temporary files

The structure is hierarchical, with the root directory at the top.

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

What command is used to display the current directory in Linux?

A

pwd

This command stands for ‘print working directory’.

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

What is the purpose of the ‘man’ command?

A

Displays the manual for a command

Example: ‘man echo’ shows usage and examples for the echo command.

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

What command is used to change directories in Linux?

A

cd

The ‘~’ character represents the home directory.

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

How can you list files in a directory?

A

Use the command ‘ls’

Options like ‘-l’, ‘-t’, and ‘-h’ can modify the output.

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

What does the ‘mkdir’ command do?

A

Creates a new directory

Example usage: ‘mkdir new_directory’.

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

What command is used to copy a file?

A

cp

For example, ‘cp source.txt destination.txt’.

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

What command is used to remove a file in Linux?

A

rm

Be cautious as deletions are permanent.

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

What are file permissions in Linux?

A

Control access to files and directories, allowing read, write, and execute permissions

Permissions are indicated by ‘r’, ‘w’, and ‘x’.

17
Q

What does the chmod command do?

A

Changes the permissions of a file or directory

Syntax example: ‘chmod g+w filename.ext’ grants write access to the group.

18
Q

What command lists all running processes?

A

ps

This command helps in monitoring active processes.

19
Q

What is the purpose of the ‘top’ command?

A

Displays CPU usage of running processes

Useful for monitoring system performance.

20
Q

What is input/output redirection in Linux?

A

Allows output of one program to be used as input for another or to write to a file

Example: ‘program_a | program_b’ or ‘program_a > file.txt’.

21
Q

What command is used to search files in a directory?

A

grep

This command enables searching through file contents.