GNU/Linux

Cards (108)

  • The command to create a new directory is mkdir
  • The /tmp directory is used by applications to store temporary files
  • The /dev directory is the device file system, which provides access to hardware devices such as drives, keyboards, mice, printers, etc.
  • The /proc directory contains information about running processes and kernel parameters
  • The /sys directory is a virtual file system that provides information about the system's state and allows you to interact with hardware devices and kernel subsystems
  • The /run directory stores runtime data generated during boot or while using the operating system
  • The /opt directory is where optional software packages are installed that don't come with the base system
  • To change permissions or ownership of a file, use chmod (change mode) and chown (change owner)
  • The /mnt directory is where removable media can be mounted temporarily
  • chown username:groupname filename(or directory) changes the ownership of the specified file to the given user and group. Use the -R option to also effect the contents within in a directory
  • The /var directory contains variable data that changes frequently or grows over time, such as logs, crash dumps, temporary files, databases, spool directories, and other dynamic content
  • Linux command-line interface (CLI) is a text-based interface that accepts commands. (Terminal)
  • The ls command displays a listing of information about files
  • The pwd command prints the working directory, indicating the user's current location within the filesystem
  • To navigate the filesystem structure, use the cd command to change directories
  • Linux directory structure has a top level called the root directory represented by /
  • There are two types of paths: absolute and relative
  • An absolute path starts at the root directory and always begins with /
  • A relative path gives directions to a file relative to your current location in the filesystem and does not start with the root directory (/)
  • The ~ character represents the home directory of the current user
  • The ls command with the -l option provides detailed information about files in a directory, such as permissions, owners, and timestamps.
  • Permissions in a file indicate how certain users can access it
  • Timestamp in a file listing indicates the time the file's contents were last modified
  • The -t option will sort the files by timestamp
  • The -S option will sort the files by file size, and the -A option will sort the files alphabetically.
  • The su command allows you to temporarily act as a different user
  • If a user account is not specified, the su command will open a new shell as the root user, providing administrative privileges
  • To use sudo, add your username to the /etc/sudoers file using the visudo command
  • When using the ls -l command, the first character of the output indicates the type of object, where - represents a file, d for directory, 1 for symbolic links, s for sockets, p for pipes, or f for FIFO
  • Permissions on a file are displayed in three sets of three characters: Owner, Group, and Other
  • There are three types of permissions that can be placed on a file or directory: read, write, and execute
  • The Read permission allows for file contents to be read or copied
  • Write permission allows for contents to be modified or overwritten
  • Execute permission allows for a file to be run as a process, which is a program that runs independently of the operating system.
  • In Linux, files and directories are owned by users and groups, and these owners determine who has access to them based on their assigned permissions.
  • Only the root user or the user who owns the file can change the permissions
  • Changing file ownership is done using the 'chown' command
  • The 'chmod' command is used to change the permissions of a file or directory
  • To execute a command as the root user, use the sudo command
  • The cat command is used to quickly view the contents of small files in Linux