linux 1-常用命令

文件处理命令:

命令格式:命令 [-选项] [参数]

例如:ls -la /etc   多个选项可以写在一起,不区分前后关系,例如 -l 和 -a 一起写成 -la

目录处理命令:ls (就是list的缩写)  ——》显示目录文件

选项:-a  显示目录下所有的文件,包括隐藏的文件

(远程登录服务器系统,用户最先是在home目录下,root用户是在 /root 目录下,普通用户是在 /home /用户名 目录下   。pwd 命令 可以查看现在所在的目录)

[root@localhost ~]# pwd
/root


[chenna@localhost ~]$ pwd
/home/chenna
[root@localhost ~]# ls -a
.                .bash_history  .bashrc      install.log.syslog  v
..               .bash_logout   .cshrc       .lesshst
anaconda-ks.cfg  .bash_profile  install.log  .tcshrc
显示的是在 /root 目录下的所有文件。其中(.文件名)是系统的隐藏文件。
. 代表当前目录
.. 代表上一级目录

  -l  显示目录下的文件的详细信息

[root@localhost ~]# ls -l
总用量 56
-rw-------. 1 root root  1208 7月  10 18:24 anaconda-ks.cfg
-rw-r--r--. 1 root root 24772 7月  10 18:24 install.log
-rw-r--r--. 1 root root  7690 7月  10 18:23 install.log.syslog
-rw-r--r--. 1 root root 10240 7月  11 09:51 v

 -d  查看目录的属性

[root@localhost ~]# ls -ld
dr-xr-x---. 2 root root 4096 7月  11 19:19 .

            

原文地址:https://www.cnblogs.com/luckycn/p/7216565.html