• linux命令(ls ,cd,pwd)


    1,ls 命令 

    ls用来打印出当前目录的清单

    ls -l/-h/-a

    -h 人性化显示

    -a 连同隐藏文件都显示出

    -F 可执行文件特殊显示带上*

    [ligang@centos6 test4]$ ls
    file  file1  folder  folder2  folder3
    [ligang@centos6 test4]$ touch .haha
    [ligang@centos6 test4]$ ls
    file  file1  folder  folder2  folder3
    [ligang@centos6 test4]$ ls -a
    .  ..  file  file1  folder  folder2  folder3  .haha
    [ligang@centos6 test4]$ ls -lh
    total 12K
    -rw-r--r-- 1 ligang trainning    0 Mar  8 05:28 file
    -rw-r--r-- 1 ligang trainning    0 Mar  8 05:29 file1
    drwxr-xr-x 2 ligang trainning 4.0K Mar  8 05:29 folder
    drwxr-xr-x 2 ligang trainning 4.0K Mar  8 05:30 folder2
    drwxr-xr-x 2 ligang trainning 4.0K Mar  8 05:29 folder3
    [ligang@centos6 test4]$ ls -la
    total 20
    drwxr-xr-x  5 ligang trainning 4096 Mar  8 06:08 .
    drwx------ 15 ligang trainning 4096 Mar  8 04:41 ..
    -rw-r--r--  1 ligang trainning    0 Mar  8 05:28 file
    -rw-r--r--  1 ligang trainning    0 Mar  8 05:29 file1
    drwxr-xr-x  2 ligang trainning 4096 Mar  8 05:29 folder
    drwxr-xr-x  2 ligang trainning 4096 Mar  8 05:30 folder2
    drwxr-xr-x  2 ligang trainning 4096 Mar  8 05:29 folder3
    -rw-r--r--  1 ligang trainning    0 Mar  8 06:08 .haha
    [ligang@centos6 test4]$ ls -lah
    total 20K
    drwxr-xr-x  5 ligang trainning 4.0K Mar  8 06:08 .
    drwx------ 15 ligang trainning 4.0K Mar  8 04:41 ..
    -rw-r--r--  1 ligang trainning    0 Mar  8 05:28 file
    -rw-r--r--  1 ligang trainning    0 Mar  8 05:29 file1
    drwxr-xr-x  2 ligang trainning 4.0K Mar  8 05:29 folder
    drwxr-xr-x  2 ligang trainning 4.0K Mar  8 05:30 folder2
    drwxr-xr-x  2 ligang trainning 4.0K Mar  8 05:29 folder3
    -rw-r--r--  1 ligang trainning    0 Mar  8 06:08 .haha

    2,dir  切换当前目录至dirName

    cd/cd~    回到用户主目录

    cd /  进入系统根目录

    cd - 返回进入此目录之前所在目录

    [ligang@centos6 test4]$ cd /
    [ligang@centos6 /]$ cd
    [ligang@centos6 ~]$ 
    [root@localhost soft]# pwd
    /opt/soft
    [root@localhost soft]# cd -
    /root
    [root@localhost ~]# pwd
    /root
    [root@localhost ~]# cd -
    /opt/soft
    [root@localhost soft]#

    3,pwd    pwd  命令来查看”当前工作目录“的完整路径

    pwd显示的是连接路径

    pwd -P  显示出实际路径

    /bin/pwd 选项

    [ligang@centos6 init.d]$ pwd
    /etc/init.d
    [ligang@centos6 init.d]$ /bin/pwd
    /etc/rc.d/init.d
    [ligang@centos6 init.d]$ pwd
    /etc/init.d
    [ligang@centos6 init.d]$ pwd -L
    /etc/init.d
    [ligang@centos6 init.d]$ pwd -P
    /etc/rc.d/init.d

  • 相关阅读:
    电脑电源灯一闪一闪开不了机怎么办
    合肥工业大学网络安全实验IP-Table
    【论文阅读】- 我对“AlexNet”的理解
    MS SQL Server 删除重复行数据
    Typora+MinIO+Python代码打造舒适协作环境
    一个前端大佬的十年回顾 | 漫画前端的前世今生
    【Hello,PyQt】最简单的一些pyqt5程序
    git切换源失败解决方案
    Linux搭建单机多进程zookeeper集群
    工作小记系列2:Kubevirt简介
  • 原文地址:https://blog.csdn.net/weixin_67271870/article/details/127438673