当前位置 主页 > 服务器问题 > Linux/apache问题 >
输出长格式列表
[root@localhost ~]# ls -1anaconda-ks.cfginstall.loginstall.log.syslogsatools
显示文件的inode信息
索引节点(index inode简称为“inode”)是Linux中一个特殊的概念,具有相同的索引节点号的两个文本本质上是同一个文件(除文件名不同外)。
[root@localhost ~]# ls -i -l anaconda-ks.cfg install.log 2345481 -rw------- 1 root root 859 Jun 11 22:49 anaconda-ks.cfg 2345474 -rw-r--r-- 1 root root 13837 Jun 11 22:49 install.log
水平输出文件列表
[root@localhost /]# ls -m bin, boot, data, dev, etc, home, lib, lost+found, media, misc, mnt, opt, proc, root, sbin, selinux, srv, sys, tmp, usr, var
修改最后一次编辑的文件
最近修改的文件显示在最上面。
[root@localhost /]# ls -ttmp root etc dev lib boot s ys proc data home bin sbin usr var lost+found media mnt opt selinux srv misc
显示递归文件
[root@localhost ~]# ls -R.:anaconda-ks.cfg install.log install.log.syslog satools./satools:black.txt freemem.sh iptables.sh lnmp.sh mysql php502_check.sh ssh_safe.sh
打印文件的UID和GID
[root@localhost /]# ls -ntotal 254drwxr-xr-x 2 0 0 4096 Jun 12 04:03 bindrwxr-xr-x 4 0 0 1024 Jun 15 14:45 bootdrwxr-xr-x 6 0 0 4096 Jun 12 10:26 datadrwxr-xr-x 10 0 0 3520 Sep 26 15:38 devdrwxr-xr-x 75 0 0 4096 Oct 16 04:02 etcdrwxr-xr-x 4 0 0 4096 Jun 12 10:26 homedrwxr-xr-x 14 0 0 12288 Jun 16 04:02 libdrwx------ 2 0 0 16384 Jun 11 22:46 lost+founddrwxr-xr-x 2 0 0 4096 May 11 2011 mediadrwxr-xr-x 2 0 0 4096 Nov 8 2010 miscdrwxr-xr-x 2 0 0 4096 May 11 2011 mntdrwxr-xr-x 2 0 0 4096 May 11 2011 optdr-xr-xr-x 232 0 0 0 Jun 15 11:04 procdrwxr-x--- 4 0 0 4096 Oct 15 14:43 rootdrwxr-xr-x 2 0 0 12288 Jun 12 04:03 sbindrwxr-xr-x 2 0 0 4096 May 11 2011 selinuxdrwxr-xr-x 2 0 0 4096 May 11 2011 srvdrwxr-xr-x 11 0 0 0 Jun 15 11:04 sysdrwxrwxrwt 3 0 0 98304 Oct 16 08:45 tmpdrwxr-xr-x 13 0 0 4096 Jun 11 23:38 usrdrwxr-xr-x 19 0 0 4096 Jun 11 23:38 var
列出文件和文件夹的详细信息
[root@localhost /]# ls -ltotal 254drwxr-xr-x 2 root root 4096 Jun 12 04:03 bindrwxr-xr-x 4 root root 1024 Jun 15 14:45 bootdrwxr-xr-x 6 root root 4096 Jun 12 10:26 datadrwxr-xr-x 10 root root 3520 Sep 26 15:38 devdrwxr-xr-x 75 root root 4096 Oct 16 04:02 etcdrwxr-xr-x 4 root root 4096 Jun 12 10:26 homedrwxr-xr-x 14 root root 12288 Jun 16 04:02 libdrwx------ 2 root root 16384 Jun 11 22:46 lost+founddrwxr-xr-x 2 root root 4096 May 11 2011 mediadrwxr-xr-x 2 root root 4096 Nov 8 2010 miscdrwxr-xr-x 2 root root 4096 May 11 2011 mntdrwxr-xr-x 2 root root 4096 May 11 2011 optdr-xr-xr-x 232 root root 0 Jun 15 11:04 procdrwxr-x--- 4 root root 4096 Oct 15 14:43 rootdrwxr-xr-x 2 root root 12288 Jun 12 04:03 sbindrwxr-xr-x 2 root root 4096 May 11 2011 selinuxdrwxr-xr-x 2 root root 4096 May 11 2011 srvdrwxr-xr-x 11 root root 0 Jun 15 11:04 sysdrwxrwxrwt 3 root root 98304 Oct 16 08:48 tmpdrwxr-xr-x 13 root root 4096 Jun 11 23:38 usrdrwxr-xr-x 19 root root 4096 Jun 11 23:38 var