• 三、基本命令


    三、基本命令

    1、cd 命令

    [root@iZbp1g3zb15nr77gr5reegZ /]# cd /usr					#进入单层目录	
    [root@iZbp1g3zb15nr77gr5reegZ usr]# cd ..					#退出所在目录
    [root@iZbp1g3zb15nr77gr5reegZ /]# cd /usr/bin				#进入多层目录
    [root@iZbp1g3zb15nr77gr5reegZ bin]#clear					#清除命令行窗口
    

    2、ls 命令

    [root@iZbp1g3zb15nr77gr5reegZ usr]# ls						#查看当前目录下面的内容
    bin  etc  games  include  lib  lib64  libexec  local  sbin  share  src  tmp
    [root@iZbp1g3zb15nr77gr5reegZ usr]# ls -ll					#查看当前目录下面的内容(列表形式)
    total 84
    dr-xr-xr-x.  2 root root 20480 Nov 30  2021 bin
    drwxr-xr-x.  2 root root  4096 Apr 11  2018 etc
    drwxr-xr-x.  2 root root  4096 Apr 11  2018 games
    drwxr-xr-x.  4 root root  4096 Apr 26  2020 include
    dr-xr-xr-x. 29 root root  4096 Apr 26  2020 lib
    dr-xr-xr-x. 39 root root 20480 Apr 26  2020 lib64
    drwxr-xr-x. 22 root root  4096 Apr 26  2020 libexec
    drwxr-xr-x. 13 root root  4096 Apr 26  2020 local
    dr-xr-xr-x.  2 root root 12288 Sep 18 21:38 sbin
    drwxr-xr-x. 77 root root  4096 Apr 26  2020 share
    drwxr-xr-x.  4 root root  4096 Apr 26  2020 src
    lrwxrwxrwx.  1 root root    10 Apr 26  2020 tmp -> ../var/tmp
    [root@iZbp1g3zb15nr77gr5reegZ usr]# ls -al		#查看当前目录下面的所有内容包括隐藏文件(列表形式)
    total 92
    drwxr-xr-x. 13 root root  4096 Apr 26  2020 .
    dr-xr-xr-x. 18 root root  4096 Sep 19 14:50 ..
    dr-xr-xr-x.  2 root root 20480 Nov 30  2021 bin
    drwxr-xr-x.  2 root root  4096 Apr 11  2018 etc
    drwxr-xr-x.  2 root root  4096 Apr 11  2018 games
    drwxr-xr-x.  4 root root  4096 Apr 26  2020 include
    dr-xr-xr-x. 29 root root  4096 Apr 26  2020 lib
    dr-xr-xr-x. 39 root root 20480 Apr 26  2020 lib64
    drwxr-xr-x. 22 root root  4096 Apr 26  2020 libexec
    drwxr-xr-x. 13 root root  4096 Apr 26  2020 local
    dr-xr-xr-x.  2 root root 12288 Sep 18 21:38 sbin
    drwxr-xr-x. 77 root root  4096 Apr 26  2020 share
    drwxr-xr-x.  4 root root  4096 Apr 26  2020 src
    lrwxrwxrwx.  1 root root    10 Apr 26  2020 tmp -> ../var/tmp
    

    3、pwd 命令

    [root@iZbp1g3zb15nr77gr5reegZ usr]# pwd					#查看当前所在目录
    /usr
    
    

    4、mkdir 命令

    [root@iZbp1g3zb15nr77gr5reegZ home]# mkdir lzb					#创建目录
    [root@iZbp1g3zb15nr77gr5reegZ home]# mkdir -p lzb2/test/output	#创建多级目录
    [root@iZbp1g3zb15nr77gr5reegZ home]# ls -ll
    total 8
    drwxr-xr-x 2 root root 4096 Sep 19 16:48 lzb
    drwxr-xr-x 3 root root 4096 Sep 19 16:50 lzb2
    

    5、rmdir 命令

    [root@iZbp1g3zb15nr77gr5reegZ home]# rmdir lzb						#移除单个文件夹
    [root@iZbp1g3zb15nr77gr5reegZ home]# rmdir -p lzb2/test/output		#移除多层文件夹
    

    6、cp 命令

    [root@iZbp1g3zb15nr77gr5reegZ home]# cp Maven.md test	#拷贝文件到指定文件夹
    [root@iZbp1g3zb15nr77gr5reegZ home]# cp Maven.md test		
    cp: overwrite ‘test/Maven.md’? y						#如果文件夹中已经存在,则输入y可以重写
    [root@iZbp1g3zb15nr77gr5reegZ home]# 
    
    

    7、rm 命令

    [root@iZbp1g3zb15nr77gr5reegZ test]# rm Maven.md 		#移除文件
    rm: remove regular file ‘Maven.md’? y
    [root@iZbp1g3zb15nr77gr5reegZ home]# rm -f test			#强制移除文件
    [root@iZbp1g3zb15nr77gr5reegZ home]# rm -r tset/test01/test02	#移除多层文件
    rm: remove directory ‘tset/test01/test02’? y
    

    8、mv 命令

    [root@iZbp1g3zb15nr77gr5reegZ home]# mv Maven.md tset/		#移动文件到指定文件夹
    [root@iZbp1g3zb15nr77gr5reegZ home]# mv tset test03			#重命名文件夹
    
  • 相关阅读:
    golang的错误处理
    Redis概述
    基于 YOLOV5 的 SAR 图像舰船检测
    图像相似度对比方法
    plt画图柱状图解决横坐标字体显示的问题竖体显示
    SQLyog连接数据库报错plugin caching_sha2_password could not be loaded
    力扣:22-括号生成
    Python 共享内存与 Qt c++ 程序进程之间通信
    CATIA Composer软件安装包分享(附安装教程)
    Java并发编程—Thread类中的start()方法如何启动一个线程?
  • 原文地址:https://blog.csdn.net/weixin_48312484/article/details/127039182