Day 3 Basic Linux Commands

Day 3  Basic Linux Commands

Linux File Hierarchy Structure

  1. / (Root Directory):

    • The top-level directory, representing the root of the file system hierarchy.
  2. /bin (Binary Binaries):

    • Essential command binaries that are required for system boot and recovery. These binaries are available to all users.
  3. /boot (Bootable Kernel Images):

    • Contains files needed for the system boot process, including the kernel, initial ramdisk, and bootloader configurations.
  4. /dev (Device Files):

    • Contains device files that represent and allow communication with hardware devices.
  5. /etc (System Configuration Files):

    • Configuration files for system-wide settings and application-specific configurations.
  6. /home (User Home Directories):

    • Home directories for regular users.
  7. /lib (Libraries):

    • Essential shared libraries needed for system boot and operation.
  8. /media (Removable Media Mount Points):

    • Mount points for removable media such as USB drives and optical disks.
  9. /mnt (Temporary Mount Points):

    • Mount points for temporary filesystems.
  10. /opt (Optional Software Packages):

    • Reserved for the installation of additional software packages that are not part of the default system installation.
  11. /proc (Process Information):

    • A virtual filesystem that provides information about running processes and system configuration.
  12. /root (Root Home Directory):

    • The home directory for the root user.
  13. /run (Runtime Data):

    • Runtime variable data such as system and process IDs, sockets, and other temporary data.
  14. /sbin (System Binaries):

    • Essential system binaries that are typically used by the root user.
  15. /srv (Service Data):

    • Data for services provided by the system, such as websites or FTP.
  16. /sys (Sysfs Virtual Filesystem):

    • A virtual filesystem that exposes information about devices and kernel parameters.
  17. /tmp (Temporary Files):

    • A directory for temporary files that are typically cleared on system reboot.
  18. /usr (User Binaries and Libraries):

    • Secondary hierarchy for user programs, libraries, documentation, and binaries.
  19. /var (Variable Data):

    • Variable files such as logs, spool files, and temporary files that may change dynamically during the operation of the system.

Basic Linux Commands

  1. pwd : Display the current working directory.

  2. mkdir : Create a new directory.

  3. ls: List files and directories.

  4. cd : Change the current working directory.

  5. rmdir : Remove an empty directory.

  6. touch: Create an empty file or update access/modification times.

  7. rm: Remove files or directories

  8. echo: Print a message to the terminal.

  9. cp: Copy files or directories.

  10. mv: Move or rename files or directories.

  11. cat: Display the content of a file.

  12. man: Display the manual or help for a command.

These are basic commands that are fundamental for interacting with the file system and managing essential tasks on a Linux system.