Help: `pwd + ls >> file` in one line for playlist

michaelsanford

Translator, Web Developer
I can do this in PHP but not the CLI.

I want to get output of the format...
/complete/path/to/file1
/complete/path/to/file2
/complete/path/to/file3

...in a single plaintext file.

How can I do that ? There's unfortunately no flag on `ls` that prints the full path.

The reason being I want to generate a playlist for sc_trans and all the files I'm going to stream are in one folder, should make it simple.
 
find /complete/path/to -name "*"

should do it. Might need to play around with flags to find to escape spaces or the like in file names, depending on what sc_trans expects.
 
find `pwd` -name "*" > sc_trans_test.lst

Produces

/Users/amras/sc_trans_library/04 Sweet Pandemonium.m4a
/Users/amras/sc_trans_library/06 The Sacrament.m4a
/Users/amras/sc_trans_library/07 The Fortress Of Tears.m4a
/Users/amras/sc_trans_library/09 Endless Dark.m4a
/Users/amras/sc_trans_library/09 Endless Dark.m4a.mp3
/Users/amras/sc_trans_library/Blackday.mp3
/Users/amras/sc_trans_library/Breathe.mp3
/Users/amras/sc_trans_library/Holy War.mp3
/Users/amras/sc_trans_library/The Root of All Evil.mp3

Which is 100 % perfect, thanks !

If sc_trans needs to escape spaces and stuff I know how to do that with sed (probably).
 
Back
Top