Linux directory structure

Have you ever looked in your / directory, you’ll see a lot of directories. Here we are presenting beginners guide to linux directory structure explaining what they mean and what are the contents of these directories.

Screenshot of contents of root directory:

linux directory structure

 

/

This is called root partition. All files and directories start with root partition. Write privileges under this directory are avaible with root user only. Not to confuse it with root user’s home directory, know the difference, “/” is root partition while root user’s home directory is “/root”.

/bin

This directory has binary executable files. Linux commands used in single user mode are found in this directory. It also holds commands that are used by all users. Examples: ls, ping, cp.

/sbin

Like /bin, /sbin also contains binary executable files but the commands held by this directory are used by system administrators with the prime purpose of system maintenance. Examples: iptables, reboot, fdisk.

/etc

It holds all the configuration files which are required by all programs. Shell scripts needed by programs to start or stop them are held by this very directory. Examples are /etc/resolv.conf, /etc/logrotate.conf

/dev

/dev contains device files. In Linux, everything is a file. Included are terminal device or usb or any other device connected to the computer. For example: /dev/usbmon0

/proc

All the system process information is held in /proc. It is a pseudo filesystem as it contains information about running processes. For an instance, /proc/ is the directory which holds information of the process with . It contains information about the system resources. /proc/uptime is one such directory.

/var

var denotes variable files. Those files are kept in this directory that are supposed to grow. Some of the files that reside in here are- /var/log (system log files), /var/lib (package files), /var/mail (emails), /var/spool (print queues), /var/tmp (temporary files that are needed across reboots).

/tmp

System generated and user generated temporary files are kept in this category. Important files should not be saved in here because contents of /tmp are flushed every time system boots.

/usr

/usr is the one that holds user programs. It contains documentations, libraries and source-code for all the second level applications. /usr/bin holds binaries for user programs. While looking for a binary after /bin also look in /usr/bin. Examples of binaries you mighht find in /usr/bin are awk, less, cc. Similarly binary files for system administrators are kept in /usr/sbin. Examples are cron, sshd, useradd. Libraries for /usr/bin and /usr/sbin are kept in /usr/lib. /usr/local holds user programs that a user installs from source.

/home

All user’s personal files are kept in their respective home directories.

/boot

This directory has boot loader files. While booting, files needed are found in /boot. Kernel initrd, grub and few more files reside in this directory.

/lib

Binaries located in /bin and /sbin are supported by library files kept in /lib. Library nomenclature goes like ld* or lib*.so.* . For example: ld-2.11.1.so

/opt

/opt is for add-on optional applications from individual vendors. All applications that are optional should be installed in /opt or any of its subdirectory.

/mnt

/mnt is our mount directory. It is the temporary mount location where where system administrators can mount temporary filesystems.

/media

It serves as the temporary mount point for removable devices. All removable devices are mounted in this directory. Example: /media/cdrom or /media/floppy.

/srv

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This book provides detailed and comprehensive comments and explanations on all source code of the early Linux kernel (V0.12), aiming to enable readers to gain a comprehensive and profound understanding of the working mechanism of Linux in a shortest possible time and to lay a solid foundation for further study of modern Linux systems. Although the version of the analysis is very low, the kernel has been able to compile and run, and it already includes the essence of the working principle of Linux. The book first briefly introduced the development history of the Linux kernel, explained the main differences between the various kernel versions and improvements, and gave the reasons for choosing the 0.12 kernel source code as the study object. Then it gives the basic knowledge needed to read the source code, outlines the hardware structure of the PC running the Linux system, the assembly language used by the kernel, the extends of C language, and focuses on the 80X86 processor in protected mode. Then we introduced the kernel code overview, given the kernel source directory tree structure, and according to the organizational structure of all kernel, programs and files are described in detail. In order to deepen the reader's understanding of the working principle of the kernel, the last chapter gives a number of related operational debugging tests. All relevant information in the book can be downloaded from the website www.oldlinux.org. This book suits as the assistant and practical teaching material of university computer major student study operating system course, also suitable for self-study reference book of Linux lovers as learning kernel operating principle, also can be used as the reference book that the general technical personnel develops the embedded system
• Table of Contents • Index The Linux® Networking Architecture: Design and Implementation of Network Protocols in the Linux Kernel By Klaus Wehrle, Frank Pählke, Hartmut Ritter, Daniel Müller, Marc Bechler Publisher : Prentice Hall Pub Date : August 01, 2004 ISBN : 0-13-177720-3 Pages : 648 Copyright ii Preface xiii Organization of this Book xiv Additional Sources of Information xv Conventions Used in this Book xvi Acknowledgments xvii Part I: The Linux Kernel 1 Chapter 1. Motivation 3 Section 1.1. The Linux Operating System 4 Section 1.2. What is Linux? 5 Section 1.3. Reasons for Using Linux 6 Chapter 2. The Kernel Structure 9 Section 2.1. Monolithic Architectures and Microkernels 11 Section 2.2. Activities in the Linux Kernel 12 Section 2.3. Locking—Atomic Operations 17 Section 2.4. Kernel Modules 23 Section 2.5. Device Drivers 29 Section 2.6. Memory Management in the Kernel 31 Section 2.7. Timing in the Linux Kernel 35 Section 2.8. The Proc File System 40 Section 2.9. Versioning 43 Part II: Architecture of Network Implementation 45 Chapter 3. The Architecture of Communication Systems 47 Section 3.1. Layer-Based Communication Models 47 Section 3.2. Services and Protocols 52 Chapter 4. Managing Network Packets in the Kernel 55 Section 4.1. Socket Buffers 55 Section 4.2. Socket-Buffer Queues 66 Chapter 5. Network Devices 71 Section 5.1. The net_device Interface 73 Section 5.2. Managing Network Devices 82 Section 5.3. Network Drivers 92 Part III: Layer I + II—Medium Access and Logical Link Layer 115 Chapter 6. Introduction to the Data-Link Layer 117 Section 6.1. Structure of the Data-Link Layer 117 Section 6.2. Processes on the Data-Link Layer 119 Section 6.3. Managing Layer-3 Protocols 127 Chapter 7. The Serial-Line Internet Protocol (SLIP) 132 Section 7.1. Introduction 132 Section 7.2. Slip Implementation in the Linux Kernel 134 Chapter 8. The Point-to-Point Protocol (PPP) 145 Section 8.1. Introduction 145 Section 8.2. PPP Configuration in Linux 148 Section 8.3. PPP Implementation in the Linux Kernel 150 Section 8.4. Implementing the PPP Daemon 158 Chapter 9. PPP over Ethernet 161 Section 9.1. Introduction 161 Section 9.2. PPPOE Specification in RFC 2516 161 Section 9.3. Implementation in the User Space 163 Section 9.4. Implementation in the Linux Kernel 164 Chapter 10. Asynchronous Transfer Mode—ATM 168 Section 10.1. Introduction 168 Section 10.2. Implementing ATM in Linux 169 Section 10.3. Configuration 177 Chapter 11. Bluetooth in Linux 179 Section 11.1. Host Controller Interface (HCI) 181 Section 11.2. L2CAP 185 Section 11.3. Other Protocols 188 Chapter 12. Transparent Bridges 189 Section 12.1. Introduction 189 Section 12.2. Basics 190 Section 12.3. Configuring a Bridge in Linux 199 Section 12.4. Implementation 202 Part IV: Network Layer 221 Chapter 13. The TCP/IP Protocols 223 Section 13.1. The Internet Protocol Suite 224 Chapter 14. The Internet Protocol V4 227 Section 14.1. Properties of the Internet Protocol 228 Section 14.2. Implementing the Internet Protocol 233 Section 14.3. IP Options 250 Section 14.4. Internet Control Message Protocol (ICMP) 262 Chapter 15. Address Resolution Protocol (ARP) 273 Section 15.1. Using the Address Resolution Protocol 274 Section 15.2. The ARP Command 276 Section 15.3. Implementing the ARP Instance in the Linux Kernel 277 Chapter 16. IP Routing 293 Section 16.1. Introduction 293 Section 16.2. Configuration 301 Section 16.3. Implementation 309 Chapter 17. IP Multicast for Group Communication 330 Section 17.1. Group Communication 331 Section 17.2. IP Multicast 333 Section 17.3. Internet Group Management Protocol (IGMP) 339 Section 17.4. Multicast Data Path in the Linux Kernel 345 Section 17.5. Multicasting in Today's Internet 355 Section 17.6. Multicast Transport Protocols 364 Chapter 18. Using Traffic Control to Support Quality of Service (QoS) 366 Section 18.1. Introduction 366 Section 18.2. Basic Structure of Traffic Control in Linux 367 Section 18.3. Traffic Control in the Outgoing Direction 367 Section 18.4. Kernel Structures and Interfaces 369 Section 18.5. Ingress Policing 378 Section 18.6. Implementing a Queuing Discipline 378 Section 18.7. Configuration 381 Chapter 19. Packet Filters and Firewalls 383 Section 19.1. Introduction 383 Section 19.2. The Ipchains Architecture of Linux 2.2 386 Section 19.3. The Netfilter Architecture of Linux 2.4 391 Chapter 20. Connection Tracking 399 Section 20.1. Introduction 399 Section 20.2. Implementation 400 Chapter 21. Network Address Translation (NAT) 410 Section 21.1. Introduction 410 Section 21.2. Configuring NAT in Linux 414 Section 21.3. Implementing the NAT Module 416 Section 21.4. Interfaces to Extend the NAT Module 422 Chapter 22. Extending the Linux Network Architecture Functionality—KIDS 426 Section 22.1. Managing Dynamically Extendable Functionalities 426 Section 22.2. Structure of the KIDS Construction System 428 Section 22.3. Using the KIDS Example to Extend the Linux Network Architecture 431 Chapter 23. IPv6—Internet Protocol Version 6 443 Section 23.1. Introduction 443 Section 23.2. IPv6 Features 443 Section 23.3. IPv6 Implementation 450 Part V: Layer IV—Transport Layer 455 Chapter 24. Transmission Control Protocol (TCP) 457 Section 24.1. Overview 457 Section 24.2. Implementing The TCP Protocol Instance 460 Section 24.3. Connection Management 476 Section 24.4. Protocol Mechanisms For Data Exchange 486 Section 24.5. Timer Management In TCP 508 Chapter 25. User Datagram Protocol (UDP) 513 Section 25.1. Introduction 513 Section 25.2. Data Structures 514 Section 25.3. Sending and Receiving UDP Datagrams 519 Chapter 26. The Concept of Sockets 522 Section 26.1. Introduction 522 Section 26.2. BSD Sockets 522 Section 26.3. Protocol-Specific Sockets 526 Part VI: Layer V—Application Layer 533 Chapter 27. Network Programming With Sockets 535 Section 27.1. Introduction 535 Section 27.2. Functions of the Socket API 538 Section 27.3. Examples 548 Part VII: Appendices 549 Appendix A. The LXR Source-Code Browser 551 Section A.1. Functionality 551 Section A.2. Installation 555 Appendix B. Debugging in the Linux Kernel 557 Section B.1. Log Outputs From the Linux Kernel 557 Section B.2. Creating Strings in the Kernel 561 Section B.3. Information in the /proc Directory 564 Section B.4. Using a Debugger with the Linux Kernel 569 Appendix C. Tools and Commands for Network Operation 572 Section C.1. Using ifconfig to Manage Network Devices 572 Section C.2. Using ping to Test the Reachability 575 Section C.3. Using netstat to View the Network State 576 Section C.4. Using route for Routing Information 578 Section C.5. Using tcpdump for Network Analysis 579 Section C.6. USING traceroute TO TRACE PACKETS 582 Section C.7. Other Tools 584 Appendix D. Example for a Kernel Module 588 Appendix E. Example for a Network-Layer Protocol 591 Appendix F. Example for a Transport Protocol 593 Appendix G. Example for Communication over Sockets 595 Section G.1. SERVER 595 Section G.2. CLIENT 598 Bibliography Index
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值