V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Shoestrong
V2EX  ›  Linux

Linux 怎么给文件夹添加备注

  •  
  •   Shoestrong · 2020-09-27 13:49:58 +08:00 · 3523 次点击
    这是一个创建于 1278 天前的主题,其中的信息可能已经有所发展或是发生改变。
    linux 怎么给文件夹添加备注

    就是平常自己项目多,分不清哪个文件是哪个项目,都要一个一个去打开去看才能确定项目


    例如:

    ----------------------------------------------------------
    > ls
    > folder-1 folder-2 folder-3
    ----------------------------------------------------------

    想要的结果:

    ----------------------------------------------------------
    > ls
    > folder-1 (文件 1 ) folder-2 (文件 2 ) folder-3 (文件 3 )
    ----------------------------------------------------------


    有哪位大牛能指点指点!
    第 1 条附言  ·  2020-09-27 16:33:39 +08:00

    我是想要后面的文件能注释

    17 条回复    2020-10-02 18:17:01 +08:00
    d0m2o08
        1
    d0m2o08  
       2020-09-27 14:15:35 +08:00
    曲线救国?


    [root@master1 tmp]# mkdir test
    [root@master1 tmp]# cd $_
    [root@master1 test]# mkdir {f1,f2,f3}
    [root@master1 test]# echo 111 > f1/111.tag
    [root@master1 test]# echo 222 > f2/222.tag
    [root@master1 test]# echo 333 > f3/333.tag
    [root@master1 test]# ll f*/*.tag
    -rw-r--r-- 1 root root 4 Sep 27 14:14 f1/111.tag
    -rw-r--r-- 1 root root 4 Sep 27 14:14 f2/222.tag
    -rw-r--r-- 1 root root 4 Sep 27 14:14 f3/333.tag
    [root@master1 test]#
    maichael
        2
    maichael  
       2020-09-27 14:16:19 +08:00
    没有

    你干嘛不在文件夹名字上体现
    reus
        3
    reus  
       2020-09-27 14:22:52 +08:00
    没有这个功能
    Shoestrong
        4
    Shoestrong  
    OP
       2020-09-27 14:22:55 +08:00
    @maichael 太难看了
    ruike007
        5
    ruike007  
       2020-09-27 14:25:47 +08:00
    没有,下一个
    TimePPT
        6
    TimePPT  
       2020-09-27 14:26:00 +08:00   ❤️ 1
    最省事的,装个 broot,直接显示目录下树状结构,快速判断。
    https://github.com/Canop/broot
    Shoestrong
        7
    Shoestrong  
    OP
       2020-09-27 14:30:59 +08:00
    @d0m2o08 这种思路是我最初想使用的,非常棒
    Jirajine
        8
    Jirajine  
       2020-09-27 14:44:45 +08:00 via Android
    @TimePPT 感谢推荐,试了一下这个真的好用。
    iminto
        9
    iminto  
       2020-09-27 14:53:18 +08:00
    @d0m2o08 更进一步

    [root@xi tmp]# mkdir {f1,f2,f3}
    [root@xi tmp]# setfattr -n user.ns -v soft f1
    [root@xi tmp]# setfattr -n user.ns -v music f2
    [root@xi tmp]# getfattr -n user.ns {f1,f2,f3}
    # file: f1
    user.ns="soft"

    # file: f2
    user.ns="music"

    f3: user.ns: No such attribute
    Shoestrong
        10
    Shoestrong  
    OP
       2020-09-27 16:30:28 +08:00
    TimePPT
        11
    TimePPT  
       2020-09-27 16:50:44 +08:00
    @Shoestrong 貌似 Mac 的文件 /文件夹注释不是写到文件,记得是生成 .DS_Store 文件,在文件里写入并映射绑定的
    TimePPT
        12
    TimePPT  
       2020-09-27 16:53:42 +08:00
    @TimePPT 囧,好像也不是,刚试了下把.DS_Store 文件删了,注释还在
    TimePPT
        13
    TimePPT  
       2020-09-27 17:02:49 +08:00
    @TimePPT 查了下,看到这篇文,介绍说现在的 macOS 应该是用文件扩展属性单存了注释内容 https://juejin.im/post/6844903869667868686
    helloworld000
        14
    helloworld000  
       2020-09-27 23:05:29 +08:00 via iPhone
    文件夹里写个 read.me?
    wangyzj
        15
    wangyzj  
       2020-09-28 10:36:22 +08:00
    @d0m2o08 #1 秒啊
    shellus
        16
    shellus  
       2020-09-28 10:46:26 +08:00
    当然是在文件夹下放个 readme.md 文件啊,有些文件管理程序,例如 github 、nextcloud 等,就支持在查看目录时在页面顶部显示 readme.md 内的内容。
    eromangame
        17
    eromangame  
       2020-10-02 18:17:01 +08:00
    kde 的 dolphin 支持这个功能,还能给文件(夹)评分,打标签
    通过添加文件扩展属性
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   967 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:22 · PVG 04:22 · LAX 13:22 · JFK 16:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.