how to output file names surrounded with quotes in SINGLE line?

后端 未结 9 1073
[愿得一人]
[愿得一人] 2021-02-03 19:47

I would like to output the list of items in a folder in the folowing way:

\"filename1\"  \"filename2\" \"file name with spaces\" \"foldername\" \"folder name wit         


        
9条回答
  •  萌比男神i
    2021-02-03 20:28

    You could also simply use find "-printf", as in :

    find . -printf "\"%p\" " | xargs your_command
    

    where:

    %p = file-path
    

    This will surround every found file-path with quotes and separate each item with a space. This avoids the use of multiple commands.

提交回复
热议问题