Linux Command Line Flashcards
What is Linux?
An open-source operating system commonly used by researchers for servers and robotics
Linux allows users to access system resources safely and efficiently.
What are the common features of Linux?
- 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.
What is the role of the kernel in Linux?
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.
What are system utilities in Linux?
- File copy
- Hard disk repair/defragmentation
- Command line tools like ls, grep, sed
System utilities perform specific tasks that enhance system functionality.
What does a Linux distribution comprise?
- Kernel
- System Utilities
- GUI (e.g., GNOME, KDE)
- Application Programs
A distribution can vary in its components and package management.
What is the significance of the /boot directory?
Contains files required for the boot process except configuration files
Essential for starting the Linux operating system.
What types of files exist in Linux?
- Ordinary File
- Directories
- Devices
- Links (Hard Link, Soft Link)
Each type serves a specific purpose within the filesystem.
What is the basic directory structure in Linux?
- /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.
What command is used to display the current directory in Linux?
pwd
This command stands for ‘print working directory’.
What is the purpose of the ‘man’ command?
Displays the manual for a command
Example: ‘man echo’ shows usage and examples for the echo command.
What command is used to change directories in Linux?
cd
The ‘~’ character represents the home directory.
How can you list files in a directory?
Use the command ‘ls’
Options like ‘-l’, ‘-t’, and ‘-h’ can modify the output.
What does the ‘mkdir’ command do?
Creates a new directory
Example usage: ‘mkdir new_directory’.
What command is used to copy a file?
cp
For example, ‘cp source.txt destination.txt’.
What command is used to remove a file in Linux?
rm
Be cautious as deletions are permanent.
What are file permissions in Linux?
Control access to files and directories, allowing read, write, and execute permissions
Permissions are indicated by ‘r’, ‘w’, and ‘x’.
What does the chmod command do?
Changes the permissions of a file or directory
Syntax example: ‘chmod g+w filename.ext’ grants write access to the group.
What command lists all running processes?
ps
This command helps in monitoring active processes.
What is the purpose of the ‘top’ command?
Displays CPU usage of running processes
Useful for monitoring system performance.
What is input/output redirection in Linux?
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’.
What command is used to search files in a directory?
grep
This command enables searching through file contents.