美文网首页
Linux 列出目录下所有文件的全路径

Linux 列出目录下所有文件的全路径

作者: 承诺一时的华丽 | 来源:发表于2019-12-25 11:46 被阅读0次
  • 查找当前目录及所有子目录文件路径
> find . -exec ls -dl \{\} \; | awk '{print $3, $4, $9}'

如果文件名有空格不能完全输出

root 197121 .
root 197121 ./122023_ggs_Windows_x64_shiphome.zip
root 197121 ./iis
root 197121 ./iis/administration.config
root 197121 ./iis/applicationHost.config
root 197121 ./iis/configEncKey.key
root 197121 ./ogg(目标端).zip
root 197121 ./ogg-x64-V34016-01.zip
root 197121 ./OGG122(源端).zip
root 197121 ./Oracle
root 197121 ./SmartForm.zip
root 197121 ./sqlhailian.bak
root 197121 ./sqlhailian.sql
root 197121 ./vcredist_x64
root 197121 ./vcredist_x64.exe
root 197121 ./vcredist_x86.exe
root 197121 ./web.zip
root 197121 ./win64_11gR2_client.zip

或者

> find . -exec ls -dl \{\} \; | awk '{print $3, $4, $0}'

root 197121 drwxr-xr-x 1 root 197121 0 11月 15 14:36 .
root 197121 -rw-r--r-- 1 root 197121 342402447 1月 15 2019 ./122023_ggs_Windows_x64_shiphome.zip
root 197121 drwxr-xr-x 1 root 197121 0 11月 15 14:36 ./iis
root 197121 -rw-r--r-- 1 root 197121 18690 1月 24 2015 ./iis/administration.config
root 197121 -rw-r--r-- 1 root 197121 78358 10月 30 2017 ./iis/applicationHost.config
root 197121 -rw-r--r-- 1 root 197121 4112 2月 14 2019 ./iis/configEncKey.key
root 197121 -rw-r--r-- 1 root 197121 511752792 1月 18 2019 ./ogg(目标端).zip
root 197121 -rw-r--r-- 1 root 197121 51020568 1月 18 2019 ./ogg-x64-V34016-01.zip
root 197121 -rw-r--r-- 1 root 197121 277254986 1月 18 2019 ./OGG122(源端).zip
root 197121 -rw-r--r-- 1 root 197121 2236026754 1月 18 2019 ./Oracle 11g.zip
root 197121 -rw-r--r-- 1 root 197121 321090012 11月 30 2018 ./SmartForm.zip
root 197121 -rw-r--r-- 1 root 197121 39932416 2月 14 2019 ./sqlhailian.bak
root 197121 -rw-r--r-- 1 root 197121 288518 2月 14 2019 ./sqlhailian.sql
root 197121 -rwxr-xr-x 1 root 197121 5673816 1月 18 2019 ./vcredist_x64 (1).exe
root 197121 -rwxr-xr-x 1 root 197121 3194536 1月 18 2019 ./vcredist_x64.exe
root 197121 -rwxr-xr-x 1 root 197121 2717352 1月 18 2019 ./vcredist_x86.exe
root 197121 -rw-r--r-- 1 root 197121 1818018104 2月 14 2019 ./web.zip
root 197121 -rw-r--r-- 1 root 197121 615698264 1月 10 2019 ./win64_11gR2_client.zip

  • Excel 分隔文件目录路径
=RIGHT(A1,LEN(A1)-FIND("./",A1)-1)

列出目录

ls -l

js 显示文件名

let res = `-rw-r--r-- 1 root 197121       1488  1月 17 10:22 client_releases-master.zip
-rw-r--r-- 1 root 197121   58661634  1月 17 10:53 client-master.zip
-rw-r--r-- 1 root 197121  150846636  1月 17 11:26 mage-master.zip
-rw-r--r-- 1 root 197121    3134104  1月 17 11:22 Service.zip
-rw-r--r-- 1 root 197121   18605819  1月 17 11:22 Service-master.zip
`.split('\n').map(a=>{
return a.substring(a.lastIndexOf(' ')+1,a.length)
});
console.log(res.join('\n'))

相关文章

  • Linux 列出目录下所有文件的全路径

    查找当前目录及所有子目录文件路径 如果文件名有空格不能完全输出 root 197121 .root 197121 ...

  • Linux 文件及目录管理命令(CentOS7)

    linux文件系统结构 显示linux根目录下所有文件,其中/为根目录 路径表示 文件路径,例如在cat文件的完整...

  • Linux 命令合集(一):文件和目录操作命令

    一、ls:列出目标目录中的所有子目录和文件 命令格式 常用参数-a:列出目录下的所有文件,包括隐藏文件-A:列出目...

  • Hello World!

    一些基本的 Linux 命令 1. ls - 列出当前目录下的目录和文件。 2. pwd - 列出当前所在路径。 ...

  • 文件操作

    判断一个路径是否存在,并创建该路径 -列出一个路径下的所有文件(包括子目录下的文件)

  • ls总结

    linux ls列出目录下所有文件数量 http://blog.hehehehehe.cn/a/12311.htm...

  • Linux 常见命令

    ls 显示文件或目 -l 列出文件详细信息l(list) 录-a 列出当前目录下所有文件及目录,包括隐藏的a(al...

  • linux 常用命令

    pwd 显示当前目录ls显示文件或目录 文件名-l:列出文件详细信息l(list)-a:列出当前目录下所有文件及目...

  • 每天一个Linux命令(14):tree 命令

    Linux tree 命令用于以树状图列出目录的内容。执行 tree 指令,它会列出指定目录下的所有文件,包括子目...

  • Linux tree命令

    tree命令 Linux tree命令用于以树状图列出目录的内容。执行tree指令,它会列出指定目录下的所有文件,...

网友评论

      本文标题:Linux 列出目录下所有文件的全路径

      本文链接:https://www.haomeiwen.com/subject/amzqoctx.html