一、ls指定的使用
ls:表示列出当前的文件下的文件目录有哪些,默认不显示隐藏文件
ls -a:表示显示隐藏文件
ls /<路径>:表示查看该文件里的文件有哪些
ls -l:表示显示详细文件的所有信息
ls -l -a(ls -al):表示所有文件的详细信息
ls -a /home/hsyl:列出该路径下所有的文件和文件夹,包括隐藏的文件
(ls 表示命令 -a 表示选项 /home/hsyl 表示参数)
[root@localhost Desktop]# ls -l
总用量 0
drwxr-xr-x. 2 root root 6 6月 11 20:17 test
-rw-r--r--. 1 root root 0 6月 11 20:17 xxx.txt
1.以上当中drwxr-xr-x的第一个字母d表示是指一个文件夹,-表示一个普通的文件,l表示一2.个连接(快捷方式),s是套接字socket的文件,t表示管道文件
rwxr-xr-x九个字母表示权限,三个为一组,分别表示所有者,所属组,其他权限 -表示没有权限
3.如果是个文件夹,这里的数字表示这个文件里有多少个子文件夹
4.如果是文件,这里的数字就表示这个文件有多少个硬链接
ls -h:表示更人性化展示信息,以kmb形式显示内存容量
注意:多个选项操作可以一起叠加
二、alias指令的使用
1.给某个指定起别名(只是一个临时起一个别名)
[root@localhost ~]# alias la='ls -a'
[root@localhost ~]# la
. .bashrc Documents Music
.. .cache Downloads Pictures
anaconda-ks.cfg .config .esd_auth Public
.bash_history .cshrc .ICEauthority .tcshrc
.bash_logout .dbus initial-setup-ks.cfg Templates
.bash_profile Desktop .local Videos
[root@localhost ~]# ls -a
. .bashrc Documents Music
.. .cache Downloads Pictures
anaconda-ks.cfg .config .esd_auth Public
.bash_history .cshrc .ICEauthority .tcshrc
.bash_logout .dbus initial-setup-ks.cfg Templates
.bash_profile Desktop .local Videos
2.unalias <别名>删除一个别名
[root@localhost ~]# unalias la
[root@localhost ~]# la
bash: la: 未找到命令...
三、mkdir指令的使用
1.mkdir -p:创建多个文件夹
[root@localhost ~]# mkdir -p add/xxx/yyy
[root@localhost ~]# ls
add Documents Music Templates
anaconda-ks.cfg Downloads Pictures Videos
Desktop initial-setup-ks.cfg Public
[root@localhost ~]# cd add
[root@localhost add]# ls
xxx
[root@localhost add]# cd xxx
[root@localhost xxx]# ls
yyy
2.rmdir:用来移除一个空文件夹
四、cp指令的使用
1.cp 原文件 复制的路径
将Desktop中的xxx.txt文件复制到Documents文件当中
[root@localhost ~]# cd Desktop/
[root@localhost Desktop]# ls
test xxx.txt
[root@localhost Desktop]# cp xxx.txt ~/Documents/
[root@localhost Desktop]# cd ~/Documents/
[root@localhost Documents]# ls
xxx.txt
2.复制并且改名字
[root@localhost ~]# cd Desktop/
[root@localhost Desktop]# ls
test xxx.txt
[root@localhost Desktop]# cp xxx.txt ~/Documents/demo.txt
[root@localhost Desktop]# cd ~/Documents/
[root@localhost Documents]# ls
demo.txt
五、mv指令的使用
1.mv 原文件 路径
用来移动一个文件(夹)
[root@localhost ~]# cd Desktop/
[root@localhost Desktop]# ls
test xxx.txt
[root@localhost Desktop]# mv test/ ~/Documents/
[root@localhost Desktop]# cd ~/Documents/
[root@localhost Documents]# ls
test
[root@localhost Documents]# cd ~/Desktop/
[root@localhost Desktop]# ls
xxx.txt
六、rm的使用
用于删除文件和文件夹(慎用rm -rf /这个命令)
用完你会很开心的!!!(电脑的虚拟机没了不要怪我)
感谢关注不迷路哦!!!