Linux系统基础命令实验 前置说明 实验手册的文件名以及目录仅供参考,大家可设置为自己便于操作的文件名或者目录,或者加上唯一标识,比如名字缩写。 命令实操 查看文件夹 以当前所在目录为/home为例: 步骤1 查看当前文件夹信息 输入: ls 输出: batchcom datasetbcpub > 使用ls命令,查看当前目录下的所有文件及文件夹。 > > 输入命令ls help 查看ls命令详情。 > > 输入: > > ls help > > 输出: > > Usage: ls [OPTION]... [FILE]... > List information about the FILEs (the current directory by default). > Sort entries alphabetically if none of cftuvSUX nor sort is specified. > > Mandatory arguments to long options are mandatory for short options too. > a, all do not ignore entries starting with . > A, almostall do not list implied . and .. > author with l, print the author of each file > > ... > ... > GNU coreutils online help: For complete documentation, run: info coreutils 'ls invocation' > > ls的命令参数有很多,本实验将一些经常使用的参数进行一一列举,帮助大家去了解ls命令。 步骤2 列表方式查看当前文件夹信息 输入: ls l 输出: total 8 rwrr 1 batchcom batchcom 7637 Apr 1 10:44 Mysql教学.ipynb drwxrx 1 batchcom batchcom 70 Apr 1 10:02 batchcom drwxrwxrwx 8 root root 168 Mar 15 22:46 datasetbcpub ls l 按照列表的形式,输出当前目录的所有信息。 一般关注文件的类型、文件的权限、文件所属的用户及用户组、文件的创建时间和文件的名称,对于文件的硬链接数本实验暂不关注。 > 这里的信息可以分为8个部分。 > > 参数选项 描述 备注 > > d 描述当前文件类型 > rwrwr 描述当前文件的权限,三个为一组 第一组对应的为该文件用户的权限 第二组为文件所属用户组的权限 第三组为其他用户组的权限 r:可读 w:可写 x:可执行 :无权限 > 1 1 8 > batchcom 当前文件的所属的用户 文件属于batchcom用户创建 > batchcom 当前文件所属的用户组 文件归属于batchcom用户组 > 7637 70 168 > Apr 1 10:44 文件的创建时间 > Mysql教学.ipynb 文件的名称 > > ls l 在Linux使用中也会简写为 ll 。