List file using ls command in Linux with full path

前端 未结 13 1623
星月不相逢
星月不相逢 2020-12-24 01:02

Many will found that this is repeating questions but i have gone through all the questions before asked about this topic but none worked for me.

I want to print full

相关标签:
13条回答
  • 2020-12-24 01:42

    you just want the full path why not use the utility meant for that a combination of readlink and grep should get you what you want

    grep -R  '--include=*.'{mkv,mp4} ? | cut -d ' ' -f3  | xargs readlink -e # 
    the question mark should be replaced with the right pattern - this is almost right
    # this is probably the best solution remove the grep part if you dont need a filter
    find <dirname> | grep .mkv | xargs readlink -e |  xargs ls --color=auto # only matroska files in the dir and subdirs with nice color - also you can edit ls flags
    find /mnt/mediashare/net/192.168.1.220_STORAGE_1d1b7 | grep .mkv 
    find /mnt/mediashare/net/192.168.1.220_STORAGE_1d1b7 | xargs grep -R  '--include=*.'{mkv,mp4} . | cut -d ' ' -f3 # I am sure you can do more with grep 
    readlink -f `ls` # in the directory or 
    
    
    0 讨论(0)
提交回复
热议问题