我正在运行以下命令来获取目录列表:
find ./../ \
-type f -newer ./lastsearchstamp -path . -prune -name '*.txt' -o -name '*.log' \
| awk -F/ '{print $NF " - " $FILENAME}'有没有什么方法可以将输出格式化为2列的左缩进布局,使输出看起来清晰易读?
上面的命令总是在文件名和路径之间添加一个恒定的空格。
预期输出:
abc.txt /root/somefolder/someotherfolder/
helloworld.txt /root/folder/someotherfolder/
a.sh /root/folder/someotherfolder/scripts发布于 2013-05-09 23:45:32
对于这类事情,我最好的工具是column -t。您只需将命令添加到管道的末尾:
find ... | awk -F/ '{print $NF " - " $FILENAME}' | column -thttps://stackoverflow.com/questions/16465747
复制相似问题