Linux学习之探索文件系统
Linux,一起学习进步~
With it, we can see directory contents and determine a variety of important file and directory attributes.
通过它,我们可以看见目录的内容、重要的文件和目录属性
~ ls
Applications Downloads Music VirtualBox VMs company
Desktop Library Pictures build doc
Documents Movies Public code system
➜ ~
Besides the current working directory,we can specify the directory to list,like so:
除了当前工作目录外,还可以指定别的目录,像这样:
ls ./code
N-chat crawl-info muying npm_ref_wf_test test
cn_admin_backend geoip-cn node-geoip npm_test999 tmp
cn_backend mail_test nodeclub personal zhongzhong
➜ ~
Or even specify multiple directories. In this example we will list both the user’s home directory(symbolized by the “~” character) and the code directory:
甚至可以列出多个目录的内容,在这个例子中,将会列出home目录和code目录的内容:
~ ls ~ ./code
./code:
N-chat crawl-info muying npm_ref_wf_test test
cn_admin_backend geoip-cn node-geoip npm_test999 tmp
cn_backend mail_test nodeclub personal zhongzhong /Users/shining3d-fyqj:
Applications Downloads Music VirtualBox VMs company
Desktop Library Pictures build doc
Documents Movies Public code system
➜ ~
Most commands use options consisting of a single character preceded by a dash, for example, “-l”, but many commands, including those from the GUN project, also support long options, consisting of a word preceded by two dashes. Also, many commands allow multiple short options to be strung together. In this example, the ls command is given two options, the “l” options to produce long format output, and the “t” option to sort the result by the file’s modification time.
大多数命令使用的选项是使用一个中划线加一个字符组成,例如“l”,但是许多命令,包括来自于UGN项目的命令,也支持长选项,长选项是由两个中划线加一个单词组成。当然,许多命令允许使用多个短选项串一起使用。下面这个例子有两个选项,“l”产生长格式输出,“t”得到按修改时间的先后顺序排序的结果。
➜ ~ ls -lt
total 0
drwx——+ 50 shining3d-fyqj staff 1700 10 28 11:13 Downloads
drwxr-xr-x 8 shining3d-fyqj staff 272 10 27 10:38 company
drwxr-xr-x 4 shining3d-fyqj staff 136 10 26 17:20 VirtualBox VMs
drwxr-xr-x 4 shining3d-fyqj staff 136 10 26 16:44 system
drwx——@ 53 shining3d-fyqj staff 1802 10 26 16:26 Library
drwxr-xr-x 18 shining3d-fyqj staff 612 10 26 14:03 code
drwx——+ 5 shining3d-fyqj staff 170 10 21 11:07 Pictures
drwxr-xr-x 9 shining3d-fyqj staff 306 10 20 16:35 doc
drwxr-xr-x 4 shining3d-fyqj staff 136 10 20 14:41 build
drwx——+ 4 shining3d-fyqj staff 136 10 16 09:14 Music
drwx——+ 5 shining3d-fyqj staff 170 9 24 15:24 Desktop
drwx——+ 10 shining3d-fyqj staff 340 9 21 14:55 Documents
drwx—— 4 shining3d-fyqj staff 136 8 17 10:31 Applications
drwx——+ 3 shining3d-fyqj staff 102 8 17 10:26 Movies
drwxr-xr-x+ 5 shining3d-fyqj staff 170 8 17 10:26 Public
➜ ~
We’ll add the long option “–reverse” to reverse the order of the sort:
得到的结果中还有delete权限的信息
➜ ~ ls -lt -reverse
total 0
0 drwxr-xr-x+ 5 shining3d-fyqj staff 170 8 17 10:26 Public
0: group:everyone deny delete
0 drwx——+ 3 shining3d-fyqj staff 102 8 17 10:26 Movies
0: group:everyone deny delete
0 drwx—— 4 shining3d-fyqj staff 136 8 17 10:31 Applications
0 drwx——+ 10 shining3d-fyqj staff 340 9 21 14:55 Documents
0: group:everyone deny delete
0 drwx——+ 5 shining3d-fyqj staff 170 9 24 15:24 Desktop
0: group:everyone deny delete
0 drwx——+ 4 shining3d-fyqj staff 136 10 16 09:14 Music
0: group:everyone deny delete
0 drwxr-xr-x 4 shining3d-fyqj staff 136 10 20 14:41 build
0 drwxr-xr-x 9 shining3d-fyqj staff 306 10 20 16:35 doc
0 drwx——+ 5 shining3d-fyqj staff 170 10 21 11:07 Pictures
0: group:everyone deny delete
0 drwxr-xr-x 18 shining3d-fyqj staff 612 10 26 14:03 code
0 drwx——@ 53 shining3d-fyqj staff 1802 10 26 16:26 Library
0: group:everyone deny delete
0 drwxr-xr-x 4 shining3d-fyqj staff 136 10 26 16:44 system
0 drwxr-xr-x 4 shining3d-fyqj staff 136 10 26 17:20 VirtualBox VMs
0 drwxr-xr-x 8 shining3d-fyqj staff 272 10 27 10:38 company
0 drwx——+ 50 shining3d-fyqj staff 1700 10 28 11:13 Downloads
0: group:everyone deny delete
➜ ~
As we explore the system it will be useful to know what files contain. To do this we will use the file command to determine a file’s type. We can invoke the file command this way:
随着探索文件系统的进行,知道文件信息是很有用的,可用file命令达此目的。我们可以这样调用:
➜ tmp file server.js
server.js: UTF-8 Unicode text
如想了解更多,请移步我的博客。
Linux学习之探索文件系统的更多相关文章
- Linux学习笔记(一) 文件系统
对于每一个 Linux 学习者来说,了解 Linux 文件系统的结构是十分有必要的 因为在 Linux 中一切皆文件,可以说只有深入了解 Linux 的文件系统,才会对 Linux 有更深刻的理解 L ...
- 【Linux学习二】文件系统
环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 一.文件系统 一切皆文件Filesystem Hierarchy St ...
- Linux学习 - 分区与文件系统
一.分区类型 1 主分区:总共最多只能分四个 2 扩展分区:只能有一个(主分区中的一个分区),不能存储数据和格式化,必须再划分成逻辑分区 才 ...
- Linux学习笔记(二) 文件管理
了解 Linux 系统基本的文件管理命令可以帮助我们更好的使用 Linux 系统,以下介绍几个常用的文件管理命令 1.pwd pwd 是 Print Working Directory 的简写,用于显 ...
- Linux学习笔记(四) vi编辑器
一.vi 编辑器 vi 编辑器 (Visual Interface) 是所有 Unix 及 Linux 系统下标准的编辑器,相当于 Windows 系统中的记事本 它有三种模式,分别是: Comman ...
- Linux学习笔记(五) 账号管理
1.用户与组账号 用户账号:包括实际人员和逻辑性对象(例如应用程序执行特定工作的账号) 每一个用户账号包含一个唯一的用户 ID 和组 ID 标准用户是系统安装过程中自动创建的用户账号,其中除 root ...
- Linux学习笔记(六) 进程管理
1.进程基础 当输入一个命令时,shell 会同时启动一个进程,这种任务与进程分离的方式是 Linux 系统上重要的概念 每个执行的任务都称为进程,在每个进程启动时,系统都会给它指定一个唯一的 ID, ...
- Linux学习笔记(七) 查询系统
1.查看命令 (1)man 可以使用 man 命令名称 命令查看某个命令的详细用法,其显示的内容如下: NAME:命令名称 SYNOPSIS:语法 DESCRIPTION:说明 OPTIONS:选项 ...
- Linux学习之CentOS(三)--初识linux的文件系统以及用户组等概念
Linux学习之CentOS(三)--初识linux的文件系统以及用户组等概念 进入到了Linux学习之CentOS第三篇了,这篇文章主要记录下对linux文件系统的初步认识,以及用户组.用户权限.文 ...
随机推荐
- 运用php做投票题,例题
要求大概是这样的,有一个题目,题目下面是复选框,要求点完复选框提交后会变成进度条,各选项的进度条百分比,和投票数量 首先还是要在数据库建两张表,如下: 要完成这个题目,需要建两个页面 <!DOC ...
- Web APi之认证(Authentication)两种实现方式【二】(十三)
前言 上一节我们详细讲解了认证及其基本信息,这一节我们通过两种不同方式来实现认证,并且分析如何合理的利用这两种方式,文中涉及到的基础知识,请参看上一篇文中,就不再叙述废话. 序言 对于所谓的认证说到底 ...
- jQuery学习之路(7)- 用原生JavaScript实现jQuery的某些简单功能
▓▓▓▓▓▓ 大致介绍 学习了妙味,用原生的JavaScript实现jQuery中的某些部分功能 定义自己的函数库lQuery ▓▓▓▓▓▓ $()选择器的实现 jQuery是面向对象的,所以自己编写 ...
- 【夯实Mysql基础】MySQL性能优化的21个最佳实践 和 mysql使用索引
本文地址 分享提纲: 1.为查询缓存优化你的查询 2. EXPLAIN 你的 SELECT 查询 3. 当只要一行数据时使用 LIMIT 1 4. 为搜索字段建索引 5. 在Join表的时候使用相当类 ...
- CSS三个定位——常规、浮动、绝对定位
.dage { width: 868px; background: #5B8C75; border: 10px solid #A08C5A; margin-top: -125px; margin-le ...
- 【SAP业务模式】之ICS(六):发票输出类型
这篇开始主要讲述发票输出类型: 首先我们新建一个发票类型,用于公司间的发票MIV,而标准的发票类型还是F2保持不变: 一.新建发票类型: 目录:SPRO-销售与分销-出具发票-开票凭证-定义出具发票类 ...
- iOS中支付宝集成
iOS中支付宝集成 如今各种的App中都使用了三方支付的功能,现在将我在使用支付宝支付集成过程的心得分享一下,希望对大家都能有所帮助 要集成一个支付宝支付过程的环境,大致需要: 1>公司:先与支 ...
- linux下 lvm 磁盘扩容
打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...
- echo命令
linux的echo命令, 在shell编程中极为常用, 在终端下打印变量value的时候也是常常用到的, 因此有必要了解下echo的用法echo命令的功能是在显示器上显示一段文字,一般起到一个提示的 ...
- [转]nopCommerce Widgets and How to Create One
本文转自:https://dzone.com/articles/what-are-nopcommerce-widgets-and-how-to-create-one A widget is a sta ...