To list the full path of all commands (apps/programs) accessible to the user. Then, you'd be able to do something like: xargs -0 rm -f - listOfFiles.list N: expands to nothing if there's no matching file ( nullglob).-N, output records are NUL-delimited instead of newline-delimited (lines) as NUL is the only character that can't be found in a file name.With the zsh shell, you could do instead: print -rNC1 $PWD/*(ND-.) > listOfFiles.list Also, since the newline character is as valid as any in a file path, if you separate the file paths with newline characters, you won't be able to use that resulting file to get back to the list of file reliably. Note that it doesn't include hidden files, includes files of any type (including directories) and if there's no non-hidden file in the directory, in POSIX/csh/rc shells, you'd get /current/wd/* as output. ls just prints that list here, so you could as well do: printf '%s\n' "$PWD"/* It's the shell that computes the list of (non-hidden) files in the directory and passes the list to ls. Note that in: ls -d "$PWD"/* > listOfFiles.list
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |