[Wlug] list filenames within directory > output to text file?

Jason Couture plaguethenet at gmail.com
Tue May 8 18:06:15 EDT 2012


# Find all files in the current directory and sub-directories, sort
them by name, and remove the leading ./ in their path. write filenames
to filelist.txt
find -type f | sort | cut -b 3- > filelist.txt
# Find all files in the current directoy only, sort by name, remove
leading ./ write filenames to filelist.txt
find -maxdepth 1 -type f -exec basename {} \; | sort > filelist.txt

On Tue, May 8, 2012 at 5:52 PM, E Johnson <iris.gates at gmail.com> wrote:
> Is there an app or command line tool which can copy all filenames
> within a certain directory, and output these filenames to a plain-text
> file?
>
> I need to list about 400 filenames, then drop these into an xl doc, in
> order to sort.
>
> Don't need to know permissions or anything else.
>
> I think sort might do it < http://ss64.com/bash/sort.html >, but
> probably I need help creating a command that will list only the file
> names, which I can then copy/paste to an xl doc.
>
> I am running Debian. I have one Squeeze and one Lenny here.
>
> Thanks extremely,
> Liz J
> _______________________________________________
> Wlug mailing list
> Wlug at mail.wlug.org
> http://mail.wlug.org/mailman/listinfo/wlug


More information about the Wlug mailing list