How to list all files in named directory, file type included?

J K

Right now i am able to list all the files using -l, and i can break it down to filename etc. using awk

e.g

ls -l ~/directory1 | awk '{print $9, $5}'

which returns something like

filename filesize

How could i also display the file type?

Lewis M

Is this what you are looking for?

find . -exec stat --format="%n %s %F" {} \;

This finds all items in the current directory, change to suite your needs, and runs the stat(1) command on each item. The %n is the item's name. The %s is the item's size. The %F is the item's type.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to recursively list all files of desired file type in a specified directory?

From Dev

How to get logged into a text file all files moved with a batch file with destination directory included in log?

From Dev

How to get a list of URLs of all included/used files of webpage?

From Dev

How To Get g++ to list paths to all #included files

From Dev

How to list all files from the resources directory

From Dev

How to retrieve a list of all files in the Working Directory

From Dev

Android: How to list all the files in a directory in to an array?

From Dev

How to list all files in a directory with absolute paths

From Dev

how to list all files in directory - deployment

From Dev

How to retrieve a list of all files in the Working Directory

From Dev

How to list all zip files in a directory?

From Dev

How to get a list of all owners of files in a directory

From Dev

How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

From Dev

How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

From Dev

List file information in a text file for all the files in a directory

From Dev

How to list all files of a directory along with an index to allow users to choose file by inputting the index number?

From Dev

Scan all files in a directory and return counts by file type

From Dev

Remove all files of a type (file extension) from whole directory tree

From Dev

Read in all the files in a particular directory displays the file names in a html list

From Dev

How to delete all files and directory except one named directory from a specific folder in centos

From Dev

How to list all files in mlocate database file?

From Dev

Python 2.7 How to list files in a directory AND all sub directories?

From Dev

How to list all CSV files in a Windows Directory using C++?

From Dev

How to list all source files in a certain directory using Make

From Dev

how to list all files and directories in given directory with full path but not recursive?

From Dev

How to list all newly created files in a specific directory?

From Dev

How to list all files in current directory whose second character is a digit?

From Dev

Python renaming a file using contents from within the file for all files of that file type in working directory

From Java

How to Create a tar file containing all the files in a directory

Related Related

  1. 1

    How to recursively list all files of desired file type in a specified directory?

  2. 2

    How to get logged into a text file all files moved with a batch file with destination directory included in log?

  3. 3

    How to get a list of URLs of all included/used files of webpage?

  4. 4

    How To Get g++ to list paths to all #included files

  5. 5

    How to list all files from the resources directory

  6. 6

    How to retrieve a list of all files in the Working Directory

  7. 7

    Android: How to list all the files in a directory in to an array?

  8. 8

    How to list all files in a directory with absolute paths

  9. 9

    how to list all files in directory - deployment

  10. 10

    How to retrieve a list of all files in the Working Directory

  11. 11

    How to list all zip files in a directory?

  12. 12

    How to get a list of all owners of files in a directory

  13. 13

    How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

  14. 14

    How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

  15. 15

    List file information in a text file for all the files in a directory

  16. 16

    How to list all files of a directory along with an index to allow users to choose file by inputting the index number?

  17. 17

    Scan all files in a directory and return counts by file type

  18. 18

    Remove all files of a type (file extension) from whole directory tree

  19. 19

    Read in all the files in a particular directory displays the file names in a html list

  20. 20

    How to delete all files and directory except one named directory from a specific folder in centos

  21. 21

    How to list all files in mlocate database file?

  22. 22

    Python 2.7 How to list files in a directory AND all sub directories?

  23. 23

    How to list all CSV files in a Windows Directory using C++?

  24. 24

    How to list all source files in a certain directory using Make

  25. 25

    how to list all files and directories in given directory with full path but not recursive?

  26. 26

    How to list all newly created files in a specific directory?

  27. 27

    How to list all files in current directory whose second character is a digit?

  28. 28

    Python renaming a file using contents from within the file for all files of that file type in working directory

  29. 29

    How to Create a tar file containing all the files in a directory

HotTag

Archive