常用命令1-命令基本格式

 

 

 

 

超级管理员他的家目录是/root

其他管理员的他的家目录是/home/用户名,test用户他的家目录就是/home/test/

pwd作用显示当前位置

[root@localhost ~]# pwd

/root

切换目录cd

切换目录cd

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# pwd

/usr/local/src

 

 

 

 

[root@localhost ~]# ls

anaconda-ks.cfg  install.log  install.log.syslog

 

[root@localhost ~]# ls -l

婊绋?44

-rw-------. 1 root root  1208 1?  9 23:47 anaconda-ks.cfg

-rw-r--r--. 1 root root 24772 1?  9 23:47 install.log

-rw-r--r--. 1 root root  7690 1?  9 23:46 install.log.syslog

权限

 

 

软链接就是快捷方式,

-rw-r--r--. 1 root root 24772 1 9 23:47 install.log

第一个-指的是文件。rw-r--r—每三个一组,第一个root所有者有rw-权限,第2root所属组拥有r权限,其他人拥有r—权限。root前边的1是的是引用计数。24772指的是文件大小,单位是字节。1 9 23:47指的是最后一次修改时间。install.log文件名

ls后加上参数和加上操作的对象

[root@localhost ~]# ls -l /etc/

婊绋?1580

drwxr-xr-x.  3 root root   4096 1?  9 23:43 abrt

drwxr-xr-x.  4 root root   4096 1?  9 23:45 acpi

-rw-r--r--.  1 root root     16 1?  9 23:47 adjtime

-rw-r--r--.  1 root root   1512 1? 12 2010 aliases

-rw-r--r--.  1 root root  12288 1? 10 00:15 aliases.db

lrwxrwxrwx.  1 root root      7 1?  9 23:41 rc -> rc.d/rc

 

h指的是人类能看到的文件大小格式

[root@localhost ~]# ls -lh

婊绋?44K

-rw-------. 1 root root 1.2K 1?  9 23:47 anaconda-ks.cfg

-rw-r--r--. 1 root root  25K 1?  9 23:47 install.log

-rw-r--r--. 1 root root 7.6K 1?  9 23:46 install.log.syslog

 

可以指定对象,也可以不指定对象,不指定对象,操作对象就是当前目录下

[root@localhost ~]# ls -lh install.log

-rw-r--r--. 1 root root 25K 1?  9 23:47 install.log

 

-a显示隐藏文件,加.的是隐藏文件看,一般是系统文件,但是一般木马病毒,就会可能是.开头的隐藏文件

[root@localhost ~]# ls -a

.   anaconda-ks.cfg  .bash_profile  .cshrc       install.log.syslog

..  .bash_logout     .bashrc        install.log  .tcshrc

 

ls -ld /etc/ ls -l /etc/区别,-l看的是对象下边的文件列表详细信息,而-ld查看的是对象本身的详细信息。

[root@localhost ~]# ls -ld /etc/

drwxr-xr-x. 102 root root 12288 1? 10 22:03 /etc/

 

每个文件都是一个节点,查看文件id号怎么查看,就用-i262147就是install.log这个文件的id号。

[root@localhost ~]# ls -i

262874 anaconda-ks.cfg  262147 install.log  262148 install.log.syslog

posted @ 2019-09-03 15:47  小杨小杨喜气洋洋  阅读(270)  评论(0编辑  收藏  举报