md5 all files in a directory tree

前端 未结 6 1651
庸人自扰
庸人自扰 2021-02-07 04:43

I have a a directory with a structure like so:

.
├── Test.txt
├── Test1
│   ├── Test1.txt
│   ├── Test1_copy.txt
│   └── Test1a
│       ├── Test1a.txt
│       └─         


        
6条回答
  •  孤街浪徒
    2021-02-07 05:24

    Use find command to list all files in directory tree, then use xargs to provide input to md5sum command

    find dirname -type f | xargs md5sum > checksums.md5
    

提交回复
热议问题