• D2关于主目录下/playground的/dir1与/dir2和fun文件


    Question:为什么多加一个/则说权限不够或者说没有?答:因为/作为一个目录的截止即/是根目录,/usr是根目录下的usr目录,而/usr/bin表示bin目录是前面的子目录,有文件或目录展开才又添加/

    soap@soap-T62Series:~/playground$ mv fun /dir1
    mv: 无法将'fun' 移动至'/dir1': 权限不够

    但是这样就可:

    soap@soap-T62Series:~/playground$ mv fun dir1

    又如

    soap@soap-T62Series:~/playground$ mv /dir1/fun /dir2
    mv: 无法获取'/dir1/fun' 的文件状态(stat): 没有那个文件或目录
    soap@soap-T62Series:~/playground$ mv /dir1/fun dir2
    mv: 无法获取'/dir1/fun' 的文件状态(stat): 没有那个文件或目录

    而不要那个/即可

    soap@soap-T62Series:~/playground$ mv dir1/fun dir2
    soap@soap-T62Series:~/playground$ mv dir2/fun .

    总结:   Verbose冗长的,罗嗦的

                    Interactive交互式的

                    Recursive递归的,循环的

                    .     这个点可以表示当前目录

        

    soap@soap-T62Series:~/playground$ ln -s ../fun dir1/fun-sym
    soap@soap-T62Series:~/playground$ ls -l dir1
    总用量 4
    -rw-r--r-- 4 soap soap 2548 6月   4 19:49 fun-hard
    lrwxrwxrwx 1 soap soap    6 6月   4 21:40 fun-sym -> ../fun

    现在删除dir1中的软链接

    soap@soap-T62Series:~/playground$ ln -s /home/soap/playground/fun dir1/fun-sym
    soap@soap-T62Series:~/playground$ ls -l dir1
    总用量 4
    -rw-r--r-- 4 soap soap 2548 6月   4 19:49 fun-hard
    lrwxrwxrwx 1 soap soap   25 6月   4 22:04 fun-sym -> /home/soap/playground/fun

    符号链接文件的长度是6和25是字符串

    ../fun和
    /home/soap/playground/fun所包含的字符数而非符号链接所指向的文件长度。


    并且关于如何理解 。。/FUN
    我们就来
    soap@soap-T62Series:~/playground$ ln -s ./fun dir2/fun-sym

    现在去目录dir2中发现fun-sym长这样

    点他他还说

     而dir1中长这样并且可以顺利打开

    所以。/fun根本没有,所以到底什么意思?

    这里我理解

    
    
    soap@soap-T62Series:~/playground$ ln -s ../fun dir1/fun-sym
    fun-sym -> ../fun
    是创建了一个叫dir1/fun-sym的软链接并且指向它的目录的父目录的fun文件
     
  • 相关阅读:
    ps 快捷键
    python中== 和 is 的区别
    微信开发者工具快捷键汇总
    IDEA常用快捷键
    非前后端分离项目使用vue继承,提取公共方法和filters
    Plupload上传插件中文帮助文档
    idea 提示 string template are not supported current JavaScrip Version 的解决
    nginx的分配方式
    nginx相关配置的内容
    Deepin启动界面个性化
  • 原文地址:https://www.cnblogs.com/penen/p/13046608.html
Copyright © 2020-2023  润新知