File Systems in Linux

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which command displays the mount points and overall disk space usage, including file system types, on a Linux system?

  • `lsblk -f`
  • `df -Th` (correct)
  • `cat /etc/fstab`
  • `inode`

What is the primary function of an inode in a file system?

  • Mapping file names to their corresponding data blocks.
  • Managing the free space within the file system.
  • Storing metadata about a file, such as permissions and size. (correct)
  • Storing the actual data of a file.

Which of the following directories under the root directory typically contains system configuration files?

  • /home
  • /tmp
  • /var
  • /etc (correct)

You need to view the contents of a file named report.txt one screen at a time. Which command is most suitable?

<p><code>less report.txt</code> (B)</p> Signup and view all the answers

What is the purpose of the /boot directory in the Linux file system hierarchy?

<p>It contains the operating system kernel and boot loader files. (D)</p> Signup and view all the answers

Which command is used to remove a file named data.txt from the file system?

<p><code>rm data.txt</code> (A)</p> Signup and view all the answers

Which command is used to display only the first 10 lines of a file?

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

Which of the following commands is used to create an empty file?

<p><code>touch</code> (D)</p> Signup and view all the answers

What is the purpose of the /var directory in the Linux file system?

<p>Storing variable data files that change during normal system operation. (D)</p> Signup and view all the answers

Which of the following commands would you use to copy a file named document.txt from your current directory to a directory named backup in your home directory?

<p><code>cp document.txt ~/backup</code> (B)</p> Signup and view all the answers

Which of the following commands can be used to display the contents of a file?

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

Which command is used to move or rename a file in Linux?

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

Which command below shows the last lines of a file?

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

Which file system is known for its journaling capabilities and is commonly used in Linux distributions?

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

What is the purpose of the /proc directory?

<p>It is a virtual file system providing information about running processes and kernel state. (A)</p> Signup and view all the answers

Flashcards

File System

Organizes and manages files on a storage device, defining how data is stored and retrieved.

ext3, ext4, XFS, BtrFS, FAT

Common file systems used in Linux, each with different features and performance characteristics.

Checking Linux file system

Commands for listing block devices with file system info, disk space usage, and file system table contents.

Inode

A data structure that stores metadata about a file, such as permissions, ownership, and file size.

Signup and view all the flashcards

Root directory

The top-level directory in a file system, from which all other directories branch.

Signup and view all the flashcards

/bin

Essential command binaries.

Signup and view all the flashcards

/etc

Configuration files for the system.

Signup and view all the flashcards

/home

User's personal directories.

Signup and view all the flashcards

/root

Administrator's home directory.

Signup and view all the flashcards

/var

Variable data, logs, and databases.

Signup and view all the flashcards

/tmp

Temporary files.

Signup and view all the flashcards

/boot

Boot loader files.

Signup and view all the flashcards

/dev

Device files representing hardware.

Signup and view all the flashcards

/lib

Shared libraries.

Signup and view all the flashcards

/media

Mount point for removable media.

Signup and view all the flashcards

Study Notes

  • Concerns the organization and storage of data on a storage device
  • ext3 is a journaling file system, a predecessor to ext4
  • ext4 is a widely used journaling file system in Linux
  • XFS is a high-performance journaling file system
  • BtrFS is a modern file system with advanced features like snapshots and CoW (Copy-on-Write)
  • FAT is a simple file system, commonly used for compatibility with other operating systems

How to Check Linux File Systems

  • lsblk -f displays block device information, including file system type and UUID
  • df -Th shows disk space usage with file system types in a human-readable format
  • cat /etc/fstab displays static file system information, defining how file systems are mounted at boot

Inode

  • A data structure in a file system that stores metadata about a file or directory

Root Directory

  • The top-level directory in a file system hierarchy, denoted as /
  • /bin contains essential user command binaries
  • /etc contains system-wide configuration files
  • /home is the default location for user home directories
  • /root is the home directory for the root user
  • /var contains variable data files such as logs and databases
  • /tmp is a directory for temporary files
  • /boot contains files required for the boot process
  • /dev contains device files
  • /lib contains essential shared libraries
  • /lib64 contains 64-bit shared libraries
  • /media is used as mount points for removable media
  • /mnt is a generic mount point for temporary file systems
  • /opt contains optional application software packages
  • /proc is a virtual file system providing process and kernel information
  • /run is a temporary file system storing runtime data
  • /sbin contains essential system administration binaries
  • /srv contains site-specific data served by the system
  • /sys is a virtual file system providing kernel and device information
  • /usr contains user-related programs, libraries, and documentation

File Management Commands

  • ls lists directory contents
  • cp copies files or directories
  • cat concatenates and displays files
  • echo displays a line of text/string
  • touch creates an empty file or updates a file's timestamp
  • rm removes files or directories
  • mv moves or renames files or directories
  • less displays file content one page at a time
  • more displays file content one page at a time
  • head outputs the first part of files
  • tail outputs the last part of files
  • nano is a simple text editor

Studying That Suits You

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

Quiz Team

More Like This

Linux File Systems Overview
242 questions
Linux File Systems
10 questions

Linux File Systems

EnchantedHoneysuckle avatar
EnchantedHoneysuckle
Use Quizgecko on...
Browser
Browser