Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Linux Filesystem Hierarchy

Linux Architecture

  1. /bin - Contains essential binary executables for the system. These are the basic command-line utilities required for the system to boot and operate in single-user mode. Examples include ls, cp, and mv.

  2. /boot - Contains the boot loader files, including the kernel and other files needed to boot the Linux operating system. This directory is critical for system startup.

  3. /dev - Contains device files. These are special files that represent hardware devices and peripherals such as hard drives, terminals, and USB devices. For example, /dev/sda represents a hard disk.

  4. /etc - Contains all the system-wide configuration files and shell scripts that are used to boot and initialize system settings. This includes configuration files for different services and applications.

  5. /home - Contains the home directories for all the system's users. Each user has a directory under /home, where they can store personal files and directories. For example, /home/username.

  6. /lib - Contains essential shared libraries needed to boot the system and run the commands in /bin and /sbin. This directory also includes kernel modules.

  7. /mnt - A mount point for temporarily mounting filesystems. This directory is commonly used by system administrators to mount storage devices or other file systems.

  8. /opt - Used for the installation of add-on application software packages. Applications that are not included in the default Linux distribution can be installed here.

  9. /proc - A virtual filesystem that provides information about running processes and the kernel. This directory contains files that are representations of system and process information.

  10. /root - The home directory of the root user (superuser). This is not the root (/) directory, but the root user's personal directory.

  11. /sbin - Contains essential system binaries that are generally used by the system administrator. These commands are crucial for system maintenance and repair. Examples include fsck, reboot, and shutdown.

  12. /srv - Contains data for services provided by the system. For example, web server data might be stored in /srv/www.

  13. /tmp - Contains temporary files that are created by system processes and applications. Files in this directory may be deleted upon system reboot.

  14. /usr - Contains user utilities and applications. This directory has several subdirectories, such as /usr/bin for user binaries, /usr/lib for libraries, and /usr/share for shared data.

  15. /var - Contains variable data files. This includes log files, mail and printer spool files, and files that are frequently modified. For example, log files are stored in /var/log.


Example Command

To view the system's user account information, you can use the following command:

cd /etc && cat passwd

This will display the contents of the /etc/passwd file, which contains user account information. Note that while this file can be viewed by all users, sensitive information such as passwords is stored in a more secure manner (e.g., /etc/shadow).


adduser and useradd

adding user

sudo deluser name - removing user

VIM/VI editor

image

image image image

Package Manager

apt advanced package tool

sudo apt install --- , sudo remove ...

nslookup dig

image

sudo chmod -R o+wrx folder - regressively addimg permission image

Change ownership

sudo chown mathew:group file

grep

grep -i term file.txt

grep -i term < file.txt giving input

grep -i term * looks for all files in current directory grep -iR will look into directory too grep -R term /etc/*

less

reader like cat, can use up and down arrow, search :q quite

more

percentage +less

head

head -2 file