linux怎么取消文件隐藏命令,Linux基础命令:显示隐藏的文件

系统中一些文件,和Windows中的系统文件一样,这些文件一般是不显示出来的,那么我们可以使用-a参数来显示隐藏的文件。如下所示: [root@Linux ~]# ls -a . .chewing .gconfd install.log .redhat .. .cshrc .gnome install.log.syslog .scim anaconda-ks.cf

系统中一些文件,和Windows中的系统文件一样,这些文件一般是不显示出来的,那么我们可以使用“-a”参数来显示隐藏的文件。如下所示:

[root@Linux ~]# ls -a

. .chewing .gconfd install.log .redhat

.. .cshrc .gnome install.log.syslog .scim

anaconda-ks.cfg Desktop .gnome2 .lesshst .tcshrc

.bash_history .dmrc .gnome2_private .metacity .thumbnails

.bash_logout .eggcups .gstreamer-0.10 .mozilla .Trash

.bash_profile .esd_auth .gtkrc-1.2-gnome2 .nautilus

.bashrc .gconf .ICEauthority .recently-used.xbel

看看这样显示的文件就比较多了。可以发现,隐藏文件是以“.”开头的文件。这些文件一般都有特殊的作用,如果显示出来,有可能被用户不小心删除。

我们可以结合上面的两个参数来显示目录下的文件,如下所示:

[root@Linux ~]# ls -al

总计 212

drwxr-x--- 18 root root 4096 03-19 05:30 .

drwxr-xr-x 24 root root 4096 03-19 12:21 ..

-rw------- 1 root root 865 03-15 04:12 anaconda-ks.cfg

-rw------- 1 root root 2372 03-19 05:52 .bash_history

-rw-r--r-- 1 root root 24 2006-07-13 .bash_logout

-rw-r--r-- 1 root root 191 2006-07-13 .bash_profile

-rw-r--r-- 1 root root 176 2006-07-13 .bashrc

drwx------ 2 root root 4096 03-14 20:32 .chewing

-rw-r--r-- 1 root root 100 2006-07-13 .cshrc

drwxr-xr-x 2 root root 4096 03-14 20:34 Desktop

-rw------- 1 root root 26 03-14 20:31 .dmrc

drwxr-x--- 2 root root 4096 03-14 20:32 .eggcups

-rw------- 1 root root 16 03-19 05:30 .esd_auth

drwx------ 4 root root 4096 03-19 05:06 .gconf

drwx------ 2 root root 4096 03-19 05:30 .gconfd

drwxr-xr-x 3 root root 4096 03-14 20:32 .gnome

drwx------ 6 root root 4096 03-19 05:30 .gnome2

drwx------ 2 root root 4096 03-14 20:32 .gnome2_private

drwxr-xr-x 2 root root 4096 03-14 20:32 .gstreamer-0.10

-rw-r--r-- 1 root root 81 03-14 20:32 .gtkrc-1.2-gnome2

-rw------- 1 root root 358 03-19 05:30 .ICEauthority

-rw-r--r-- 1 root root 27964 03-15 04:12 install.log

-rw-r--r-- 1 root root 5069 03-15 04:11 install.log.syslog

-rw------- 1 root root 35 03-19 05:26 .lesshst

drwx------ 3 root root 4096 03-14 20:32 .metacity

drwx------ 3 root root 4096 03-14 20:36 .mozilla

drwxr-xr-x 3 root root 4096 03-19 05:30 .nautilus

-rw-r--r-- 1 root root 1528 03-19 05:30 .recently-used.xbel

drwxr-xr-x 3 root root 4096 03-14 20:32 .redhat

drwx------ 4 root root 4096 03-14 21:06 .scim

-rw-r--r-- 1 root root 129 2006-07-13 .tcshrc

drwx------ 3 root root 4096 03-14 20:33 .thumbnails

drwx------ 2 root root 4096 03-14 20:32 .Trash

这样显示是不是觉得更好呢?
参考链接:
3 ways to show hidden files in Linux

作者:鹏达原文地址:https://segmentfault.com/a/1190000042073243

%s 个评论

要回复文章请先登录注册