General overview of the Linux file system

本文深入探讨了Linux文件系统的布局与使用方法,包括常见的分区用途、根目录下的子目录及其内容,以及如何通过命令查找特定分区。提供了一个全面的Linux文件系统导航指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

3.1.1. Files

3.1.1.1. General

A simple description of the UNIX system, also applicable to Linux, is this:

"On a UNIX system, everything is a file; if something is not a file, it is a process."

A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system.

  • a partition for user programs (/usr)

  • a partition containing the users' personal data (/home)

  • a partition to store temporary data like print- and mail-queues (/var)

  • a partition for third party and extra software (/opt)

For convenience, the Linux file system is usually thought of in a tree structure.

igure 3-1. Linux file system layout


Table 3-2. Subdirectories of the root directory

DirectoryContent
/binCommon programs, shared by the system, the system administrator and the users.
/bootThe startup files and the kernel, vmlinuz. In some recent distributions also grub data. Grub is the GRand Unified Boot loader and is an attempt to get rid of the many different boot-loaders we know today.
/devContains references to all the CPU peripheral hardware, which are represented as files with special properties.
/etcMost important system configuration files are in /etc, this directory contains data similar to those in the Control Panel in Windows
/homeHome directories of the common users.
/initrd(on some distributions) Information for booting. Do not remove!
/libLibrary files, includes files for all kinds of programs needed by the system and the users.
/lost+foundEvery partition has a lost+found in its upper directory. Files that were saved during failures are here.
/miscFor miscellaneous purposes.
/mntStandard mount point for external file systems, e.g. a CD-ROM or a digital camera.
/netStandard mount point for entire remote file systems
/optTypically contains extra and third party software.
/procA virtual file system containing information about system resources. More information about the meaning of the files in proc is obtained by entering the command man proc in a terminal window. The file proc.txt discusses the virtual file system in detail.
/rootThe administrative user's home directory. Mind the difference between /, the root directory and /root, the home directory of the root user.
/sbinPrograms for use by the system and the system administrator.
/tmpTemporary space for use by the system, cleaned upon reboot, so don't use this for saving any work!
/usrPrograms, libraries, documentation etc. for all user-related programs.
/varStorage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for temporary storage of files downloaded from the Internet, or to keep an image of a CD before burning it.

How can you find out which partition a directory is on? Using the df command with a dot (.) as an option shows the partition the current directory belongs to, and informs about the amount of space used on this partition:

sandra:/lib> df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda7             980M  163M  767M  18% /



资源下载链接为: https://pan.quark.cn/s/22ca96b7bd39 在当今的软件开发领域,自动化构建与发布是提升开发效率和项目质量的关键环节。Jenkins Pipeline作为一种强大的自动化工具,能够有效助力Java项目的快速构建、测试及部署。本文将详细介绍如何利用Jenkins Pipeline实现Java项目的自动化构建与发布。 Jenkins Pipeline简介 Jenkins Pipeline是运行在Jenkins上的一套工作流框架,它将原本分散在单个或多个节点上独立运行的任务串联起来,实现复杂流程的编排与可视化。它是Jenkins 2.X的核心特性之一,推动了Jenkins从持续集成(CI)向持续交付(CD)及DevOps的转变。 创建Pipeline项目 要使用Jenkins Pipeline自动化构建发布Java项目,首先需要创建Pipeline项目。具体步骤如下: 登录Jenkins,点击“新建项”,选择“Pipeline”。 输入项目名称和描述,点击“确定”。 在Pipeline脚本中定义项目字典、发版脚本和预发布脚本。 编写Pipeline脚本 Pipeline脚本是Jenkins Pipeline的核心,用于定义自动化构建和发布的流程。以下是一个简单的Pipeline脚本示例: 在上述脚本中,定义了四个阶段:Checkout、Build、Push package和Deploy/Rollback。每个阶段都可以根据实际需求进行配置和调整。 通过Jenkins Pipeline自动化构建发布Java项目,可以显著提升开发效率和项目质量。借助Pipeline,我们能够轻松实现自动化构建、测试和部署,从而提高项目的整体质量和可靠性。
The goal of task 1 The goal of this exercise is to implement a Stack data structure. The implementation must pass all the tests included in the exercise. Time complexity requirements: capacity(): O(1). push(): O(1), except for when reallocation must be done: O(n). pop(): O(1). peek(): O(1). size(): O(1). isEmpty(): O(1). toString(): O(n). clear(): O(1). When implementing clear() you may decide yourself if you want to keep the current capacity or will the capacity be the default capacity of a queue. Note that the method toString() in this and later execises must be implemented using Java StringBuilder, not by using the String by modifying and appending to a String object. When handling large amounts of data elements, with String, this is hundreds of times slower than using StringBuilder. This has already been implemented for you. Prerequisites You have all the tools installed and working. This was tested in the 00-init exercise of the course. If you haven't done that yet, do it now. Instructions An overview of the classes in this exercise is shown in the UML class diagram below. Note that in this task, you only work with the StackImplementation class. The class ParenthesisTChecker.java and StackFactory.createCharacterStack() are not needed until you start working with the additional tasks. If you want to, you may crete your own main app file, for example in src/main/java/oy/tol/tra/Main.java, where you may implement your own main() method to experiment with your stack implementation. However, the main goal of the exercise is to pass all the unit tests. Do not implement main() method to data structure classes or test classes! Before delivery, remove all main functions an any unnrcessary test code. UML class diagram You should implement the interface StackInterface in the StackImplementation.java which is already created for you and located in this project's src/main/java/oy/tol/tra/ directory! Note that the StackImplementation uses E template parameter for the StackInterface: public class StackImplementation<E> implements StackInterface<E> { So the stack is a generic (template) class. Make sure to read the StackInterface documentation (the comments in the code) carefully so that your implementation follows the interface documentation. Obviously you need to know how stacks work in general, so check out the course lectures and other material on stack data structures. In this exercise, you use the Java plain array as the internal data structure for holding the elements: private Object [] itemArray; Since all Java classes inherit from Object, we can create an array of Objects for the elements. In the StackImplemention, constructors, follow the code comments and allocate the array of elements, in addition to other things you need to implement: itemArray = new Object[capacity]; Make sure to implement reallocating more room in the StackImplementation internal array if array is already full, when push() is called! After you have implemented your stack class methods, you can see that it is already instantiated for you in StackFactory.createIntegerStack(). After this, you are ready to test your implementation.
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值