How can I generate a list of files with their absolute path in Linux?

后端 未结 21 2242
天涯浪人
天涯浪人 2020-11-28 16:56

I am writing a shell script that takes file paths as input.

For this reason, I need to generate recursive file listings with full paths. For example, the file

21条回答
  •  半阙折子戏
    2020-11-28 17:29

    Command: ls -1 -d "$PWD/"*

    This will give the absolute paths of the file like below.

    [root@kubenode1 ssl]# ls -1 -d "$PWD/"*
    /etc/kubernetes/folder/file-test-config.txt
    /etc/kubernetes/folder/file-test.txt
    /etc/kubernetes/folder/file-client.txt
    

提交回复
热议问题