Linux: 文件目录指令

1、绝对路径和相对路径

image.png

2、pwd 和 ls 指令

image.png

3、cd 切换到不同目录下指令

它可以帮助我们移动到不同的路径,从而方便我们进行文件管理
image.png

4、 mikdir 创建目录指令

image.png

5、rmdir 和 rm 删除目录

image.png

6、touch 创建空文件

image.png

7、cp 拷贝文件

image.png

8、rm 删除文件或目录

image.png

9、移动文件与目录或文件重命名

Linux: 文件目录指令-每日运维
移动文件的同时并且修改文件名

 mv pig.txt /home/dog.txt

10、cat 查看文件的内容【只读】

cat /ect/profile -n | more

image.png

11、more 查看文件的内容

image.png

12、less 查看大文件内容

image.png

13、echo 输出内容到控制台

image.png

用法如下:

image.png

14. head 查看文件默认前 10 行内容

image.png

[root@hecs-165269 ~]# head /etc/profile -n 4
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
[root@hecs-165269 ~]#

15. tail 查看文件默认 尾 10 行内容

image.png

16. > 输入重定向指令 和 >> 追加指令

image.png

17. ln 软链接

Linux: 文件目录指令-每日运维

Linux: 文件目录指令-每日运维

18. history 查询执行的操作命令

Linux: 文件目录指令-每日运维