linux - Bash - 查找最大文件并打印其路径

标签 linux bash ubuntu

<分区>

我需要找到所选目录和子目录的最大文件并打印该文件的路径

我能找到最大的文件(我想是的)

find . -type f | wc -l

但是,我坚持打印路径

最佳答案

find . -type f | xargs ls -l | sort -nk 5 | tail -n1 | awk '{print $NF}'

关于linux - Bash - 查找最大文件并打印其路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47870799/

相关文章:

linux - Cron 说 "errors in crontab file, cannot install"

c - 如何在c开发过程中避免内存泄漏

bash - Shell脚本对编码和行尾是否敏感?

linux - bash 变量扩展通过管道传输到 ssh

linux - 如何在 Bash 脚本中用转义版本替换特殊字符

python - 如何在 VSCode 中运行 python3 代码?/bin/sh : 1: python: not found

linux - 阻塞套接字和非阻塞套接字有什么区别? (对于 realz 版)

php - 如何在linux平台上使用laravel 5和sqlserver?

ubuntu - OpenSSH 服务器安装导致错误 E : Unable to correct problems, 你持有损坏的包

r - 如何在 ubuntu 中升级 R?