Linux File System Basics

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What role do file systems play in data storage?

  • They encrypt the data to secure it.
  • They organize data on a storage medium. (correct)
  • They transmit the data over a network.
  • They compress the data to save space.

In Linux, each disk drive is labeled with an identifying letter like C: or D:, similar to Windows.

False (B)

In the context of UNIX, what broader scope does the definition of a 'file' encompass beyond just typical data files?

Anything from which data can be taken or sent, including I/O devices.

In Linux, devices like printers and terminals are represented as ______ files.

<p>special</p> Signup and view all the answers

Match the following UNIX file types with their descriptions:

<p>Ordinary files = Common computer files containing data, text, or executable instructions. Special files = Represent physical devices like terminals and printers. Directory files = Collections that organize ordinary and special files.</p> Signup and view all the answers

In the Linux file system, what is the root directory identified by?

<p>/ (C)</p> Signup and view all the answers

The /home directory contains system-wide configuration files in Linux.

<p>False (B)</p> Signup and view all the answers

What is the purpose of the /boot directory in Linux?

<p>Contains files needed to boot the computer, including the kernel and bootloader configuration.</p> Signup and view all the answers

In Linux, media devices such as USB drives are typically referenced in the /______` directory when plugged in.

<p>media</p> Signup and view all the answers

Match the following Linux directories with their functions:

<p>/etc = System-wide configuration files /var = Variable data files, such as log files /opt = Optional software installation /tmp = Temporary files</p> Signup and view all the answers

Which directory in Linux contains software vital for the system to boot?

<p>/bin (A)</p> Signup and view all the answers

The /root directory is the same as the root directory / in the Linux file system.

<p>False (B)</p> Signup and view all the answers

What is the main function of the Super key in Unity keyboard shortcuts?

<p>To open the Launcher and display available shortcuts.</p> Signup and view all the answers

Using the shortcut Super-______ (1-9) is equivalent to clicking on a Launcher icon in Unity.

<h1></h1> Signup and view all the answers

Match the following Unity keyboard shortcuts with their functions:

<p>Alt-Tab = Switch between applications. Super-W = Spread all windows in the current workspace. Ctrl + Super-D = Minimize all windows. Alt-F4 = Close current window.</p> Signup and view all the answers

What is the purpose of Alt-Left mouse drag shortcut?

<p>Move window (C)</p> Signup and view all the answers

Linux operating systems do not have the ability to multitask.

<p>False (B)</p> Signup and view all the answers

Why does Linux need permissions?

<p>To protect users from each other.</p> Signup and view all the answers

In Linux users and groups are used to control ______ to the system's files, directories, and peripherals.

<p>access</p> Signup and view all the answers

Match the definitions to the term:

<p>User = Anyone who uses a computer. Group = A collection of users form. Root = Administrative user.</p> Signup and view all the answers

What is the purpose of adding Linux users to a group?

<p>To utilize privileged access granted to the group. (A)</p> Signup and view all the answers

Mandatory access permissions are only available on the Linux operating system.

<p>False (B)</p> Signup and view all the answers

What are the three types of permissions objects have?

<p>Read, write, and execute.</p> Signup and view all the answers

The ______ is by default the user that created the object.

<p>owner</p> Signup and view all the answers

Match the permissions to their use for direcotries;:

<p>Read = Ability to see the names of objects and their information contained in it. Write = Abilit to create and delete objects in it. Execute = Abilit to enter the directory to open objects within it.</p> Signup and view all the answers

Which command will change the owner?

<p>chown (B)</p> Signup and view all the answers

Each Linux users has a user ID and a group ID, these stay the same.

<p>False (B)</p> Signup and view all the answers

What is a file /etc/passwd?

<p>The default group for a user.</p> Signup and view all the answers

Use the ______ command to create a new group.

<p>groupadd</p> Signup and view all the answers

Match the group commands to their function.

<p>groupdel = Delete a group. groupmod = Modify a group.</p> Signup and view all the answers

Who generally uses the Command: Chown?

<p>Only root. (D)</p> Signup and view all the answers

The /root and / directory are the same.

<p>False (B)</p> Signup and view all the answers

How can the UID of a currrent user be displayed?

<p>echo $UID</p> Signup and view all the answers

The dollar sign preceding UID tells echo to display its ______ rather than its name.

<p>value</p> Signup and view all the answers

Match the commands.

<p>su = Provides them with root privileges only as needed and without requiring a new login. kdesu = Provides them with root privileges only as needed and without requiring a new login. sudo = Provides them with root privileges only as needed and without requiring a new login.</p> Signup and view all the answers

What is the purpose of a rootkit?

<p>A set of software tools secretly installed by an intruder. (D)</p> Signup and view all the answers

Administrators shouldn't log in with their ordinary user accounts.

<p>False (B)</p> Signup and view all the answers

Why should using the root account be avoided?

<p>To prevent users from directly damaging Unix-like systems or increasing the vulnerability of such systems to damage by others.</p> Signup and view all the answers

Root privileges are usually required for installing software in ______ (Red Hat Package Manager) package format because of the need to write to system directories.

<p>RPM</p> Signup and view all the answers

Match the folder to it's description

<p>/root = This is the home directory for the main superuser. /bin = Software that is vital for the system to be able to boot is stored here. /sbin = Software that should be run only by the superuser is stored here.</p> Signup and view all the answers

Signup and view all the answers

Signup and view all the answers

Signup and view all the answers

Signup and view all the answers

Signup and view all the answers

Flashcards

File Systems

Mechanisms by which data on a storage medium gets organized.

UNIX File Definition

Expands the usual file definition to include anything data can be taken from or sent to, including I/O devices.

Ordinary Files

Common computer files.

Special Files

Represent physical devices like terminals and printers.

Signup and view all the flashcards

Directory Files

Collections that organizes ordinary and special files.

Signup and view all the flashcards

Root Directory

The top-level directory in the file system, denoted by '/'.

Signup and view all the flashcards

/boot Directory

Contains important files to boot the computer, including bootloader configuration and the kernel.

Signup and view all the flashcards

/dev Directory

Contains entries for each device on your system, such as sound cards and webcams.

Signup and view all the flashcards

/etc Directory

Stores system-wide configuration files for installed software.

Signup and view all the flashcards

/home Directory

Stores each user account's home directory.

Signup and view all the flashcards

/lib Directory

Stores important system software libraries. Avoid delving into this directory.

Signup and view all the flashcards

/media Directory

References media devices like CD drives and USB sticks when plugged in.

Signup and view all the flashcards

/mnt Directory

Used for mounting other devices.

Signup and view all the flashcards

/opt Directory

Where optional software can be installed, often used when building your own software.

Signup and view all the flashcards

/proc/sys Directory

Stores information about the current running status of the system.

Signup and view all the flashcards

/root Directory

The home directory for the main superuser.

Signup and view all the flashcards

/bin Directory

Stores software that is vital for the system to boot.

Signup and view all the flashcards

/sbin Directory

Stores software that should be run only by the superuser.

Signup and view all the flashcards

/usr Directory

Where general software is installed.

Signup and view all the flashcards

/var Directory

Contains log files about the software on your computer.

Signup and view all the flashcards

Users and Groups

Controls access to the system's files, directories, and peripherals.

Signup and view all the flashcards

A User

Anyone who uses a computer.

Signup and view all the flashcards

Linux User

A user with valid access to the system, similar to a Windows account.

Signup and view all the flashcards

Linux Access Permissions

A system of mandatory access permissions for every object.

Signup and view all the flashcards

Three Types of Permissions

read, write, and execute.

Signup and view all the flashcards

Three Types of Users

owner, group, and others.

Signup and view all the flashcards

Group Permissions

Facilitate cooperative work by associating users with a group.

Signup and view all the flashcards

Read Permission (Directory)

Ability to see names and info. in a directory.

Signup and view all the flashcards

Write Permission (Directory)

Ability to create and delete objects in directory.

Signup and view all the flashcards

Execute Permission (Directory)

Allows entering the directory to open objects within it.

Signup and view all the flashcards

chmod command

Command to change the permissions of an object.

Signup and view all the flashcards

chown command

Command to change the owner of an object.

Signup and view all the flashcards

chgrp command

Command to change the group ownership of an object.

Signup and view all the flashcards

User, Group, Other Permissions

Identification status to grant or deny read, write, execute access to files, directories, etc.

Signup and view all the flashcards

User ID (UID)

A unique numerical identification number for each Linux user.

Signup and view all the flashcards

Linux Groups

A way to manage a collection of computer system users.

Signup and view all the flashcards

useradd

Command to create a new user and assign it to a group.

Signup and view all the flashcards

groupadd

Command to create a new group.

Signup and view all the flashcards

Root User

A user or account with access to all commands on a Linux system.

Signup and view all the flashcards

Rootkit

A set of software tools secretly installed for malicious purposes.

Signup and view all the flashcards

Study Notes

Linux File System (FS) Basics

  • File systems are the mechanisms for organizing data on a storage medium.
  • The way Linux stores and organizes files differs significantly from Windows and Mac OS X.
  • In Linux, hard disks, CD drives, and USB sticks are part of the same folder structure.

What is a File in UNIX?

  • UNIX expands the definition of a file to include anything data can be taken from or sent to.
  • It can refer to I/O devices like keyboards and printers.
  • In UNIX, everything that the OS deals with is often referred to as a file.

Kinds of UNIX Files

  • Ordinary files: Common computer files.
  • Special files: Also called device files, representing physical devices like terminals and printers.
  • Directory files: Collections of ordinary and special files.

Linux Directory Structure

  • The file system has a tree-shaped structure.
  • The root folder is at the top of the tree, represented by " / ".
  • The /home folder contains home directories for each user.
  • User accounts have their home folder set to /home/[username].

Important Folders in Linux

  • /boot: Contains files needed to boot the computer, including the bootloader configuration and kernel.
  • /dev: Contains entries for each device on the system, and applications access devices using items inside /dev.
  • /etc: Stores system-wide configuration files for installed software.
  • /home: Home directories for each user account are stored here.
  • /lib: Stores important system software libraries.
  • /media: References media devices like CD drives and USB sticks when plugged in.
  • /mnt: Used for mounting other devices.
  • /opt: Used for installing optional software; often used when building software.
  • /proc/sys: Stores the current running status of the system.
  • /root: The home directory for the main superuser.
  • /bin: Stores software vital for the system to boot.
  • /sbin: Stores software that should only be run by the superuser.
  • /usr: Installs general software.
  • /var: Contains log files about the software on the computer.

Unity Keyboard Shortcuts: The Super Key

  • The Super Key is used for shortcuts and is known as the Windows key.
  • Super (long press): Opens the Launcher and displays shortcuts.
  • Super-Tab: Switches applications via the Launcher.
  • Super-# (1-9): Acts like clicking on a Launcher icon.
  • Super-Shift-# (1-9): Opens a new window for the same application.
  • Super-T: Opens Trash.

More Unity Keyboard Shortcuts

  • Alt-Tab: Switches between applications.
  • Alt-: Holds Alt and presses to switch between windows of the current application.
  • Cursor left or right: Moves the focus within lists or images of applications when switching or in a menu.
  • Super-W: Spreads all windows in the current workspace.
  • Ctrl + Super-D: Minimizes all windows.
  • Ctrl + Super-Cursor up: Maximizes the current window.
  • Ctrl + Super-Cursor down: Restores or minimizes the current window.
  • Ctrl + Super-Cursor left or right: Semi-maximizes the current window.
  • Alt-F4: Closes the current window.
  • Alt-Space: Opens the window accessibility menu.
  • Ctrl-Alt-Num: Places the window in corresponding positions on the screen.
  • Alt-Left mouse drag: Moves the window.
  • Super-L: Locks the screen.

Linux Users, Groups, and Permissions

  • Linux and Unix systems can multitask and allow multiple users simultaneously.
  • Permissions protect users from each other in a multi-user environment.
  • Users and groups control access to files, directories, and peripherals.
  • A user is anyone who uses a computer and is represented by a username.

Linux Users and Access

  • A user in Linux requires valid access to the system similar to Windows accounts.
  • Each user needs an account on the system.
  • Access is granted with a valid username and password.
  • Users can be grouped to utilize privileged access.
  • A collection of users forms a group, which shares privileges and access controls.
  • Access permissions for files, directories, and links are mandatory in Linux.
  • Permissions provide a high level of security and stability.
  • Three types of permissions exist: read, write (modify), and execute (run as a program).
  • Permissions are defined for the owner, the group, and all others.
  • The owner is the user that created the object, by default.
  • The root user has all three types of permissions for every object on the system.
  • The root user can change permissions and transfer object ownership.
  • Group permissions facilitate cooperative work.
  • Object owners can associate users with a group to grant access rights.
  • Granting access is more convenient for objects requiring access by the same users.

Permissions for Files vs. Directories

  • Read permission for a directory allows viewing the names and info of the objects within it.
  • Write permission allows creating and deleting objects within a directory.
  • Execute permission allows entering a directory to open objects.
  • Nine bits of permission information are associated with each object, determined by the type of user.
  • Each bit can be either permitted or denied.
  • Use the "chmod" command to change permissions.
  • Use the "chown" command to change the owner.
  • Use the "chgrp" command to change group ownership.
  • File, directory, and device permissions are granted based on user, group, or other identification status.
  • Permission is granted (or denied) for read, write, and execute access.

Linux User and Group IDs

  • All Linux users have a numerical user ID (UID) and group ID (GID).
  • Groups logically tie users together for security, privilege, and access.
  • Groups form the foundation of Linux security and access.
  • Files and devices are granted access based on User or Group ID.

Linux Groups

  • Linux groups manage collections of computer system users.
  • Users are members of a default group.
  • Ubuntu Linux, Fedora Core, and CentOS add new users to a group with the same name as the username.
  • You can find the default group for a user is specified in the /etc/passwd file.
  • A new user may be created and assigned a group with the useradd command.
  • Use the groupadd command to create a new group like "accounting".
  • Graphical interfaces from GNOME or KDE handle user and group management.

Group Commands

  • groupadd: Creates a new group.
  • groupmod: Modifies a group.
  • groupdel: Deletes a group.
  • Chown: Used by root to change the group ownership of a file, directory, or device via "chmod".
  • Syntax example to change to the accounting group is chown :accounting filename.
  • chgrp: Changes file ownership to another group of which one is a member.

The Linux Super User

  • Root is the username or account with access to all commands and files, also known as the root account, root user, and superuser.
  • The root directory is designated by a forward slash (/).
  • /root (slash root) is the root user's home directory.

Home Directories Explained

  • A home directory is the primary repository for a user's files and configuration files.
  • By default, it's the directory a user finds upon logging in.
  • /root is a subdirectory of the root directory.
  • Home directories for non-root users are created in the /home directory.

Root Privileges

  • Root privileges are the powers of the root account.
  • Root has absolute power over the system, including complete access to all files and commands.
  • Root can modify the system, grant, and revoke access permissions.
  • Every user account is automatically assigned a UID.
  • The system uses UIDs instead of usernames to identify and track users.

The Echo Command and Root UID

  • You can display the current UID with the command echo $UID.
  • The dollar sign tells echo to display the UID's value.
  • In Ubuntu and Fedora, the UID for new users starts from 1000.
  • The UID of the root can be found in the /etc/passwd file.
  • Root always has a UID of zero.

Rootkits and Security

  • A rootkit is a set of software tools secretly installed by an intruder.
  • Rootkits allow intruders to use the computer for malicious purposes.
  • It's best to avoid use of the root account except when necessary.

Administrative Alternatives to Direct Root Logins

  • Administrators should log in with ordinary user accounts.
  • They can then use commands like su, kdesu, and sudo.
  • These provide root privileges as needed without requiring a new login.
  • Root privileges install software in RPM format due to the need to write to system directories.

Root Privileges and Software Installation

  • Ordinary users don't need root privileges to compile/install in their home directories.
  • Large systems have multiple administrators, each with their account.
  • Admins also have access to the root account for necessary use.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser