English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need a simple way to generate a list of file in a folder (and subfolder) in a linux shell.
I am using
dir -1 -R > filelist.txt
but it only give me the file names in each folder,
.folder1:
file1.txt
file2.txt
I need the full path to the files like
folder1/file1.txt
folder1/file1.txt
folder1/subfolder2/file3.txt

I must be missing something simple.
Thanks for any help.

2007-04-04 06:41:26 · 2 answers · asked by song_ny 2 in Computers & Internet Other - Computers

2 answers

dir is usually a command just for windows users who cant remember the ls (list) command. And I could probably find a way to do it but I think for what you want the find command might work better.

find . >filelist.txt
(be sure to include that period after find. That means "starting here")

2007-04-05 09:23:14 · answer #1 · answered by Gandalf Parker 7 · 0 0

Your defaulting on your information folder. you are able to substitute force letters like "D:" and you are able to return a folder like so "cd.." so sort "cd.." with out the parentheses hit enter, and repeat. Dir lists all information in folder you're in. cd "folder call" is going right into a folder. cd.. is going back a folder

2016-12-08 18:11:00 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers