[go: up one dir, main page]

Menu

dk-ls

Dirk Krause
← Previous ↑ Home → Next

dk-ls — List files, configurable column order

Description

The dk-ls program shows information about files. There are some differences to traditional ls or dir programs:

  • Configurable output column order
    The output column order is configurable. To search for newest files, print modification time first and use a "sort" program.
    To search for largest files, print size first and use a numeric sort…
     
  • Directory size calculation
    The size shown for a directory is the summary of the directory size and the contents size.
     
  • Use of UTF-16 encoding for output on Windows
    On Windows the program produces UTF-16 encoded output, so it can show non-English text in file names properly.

Examples

Find newest files (last modified)

To find the files last modified:

dk-ls -r -tf -pmtn | dk-sort
Program Option Purpose
dk-ls List files.
-r Recursive listing including all subdirectories.
-tf Restrict output to files (non-directory items).
-pmtn Set print order to:
  • m Modification time
  • t File type
  • n File name
dk-sort Sort text line by line alphabetically.

Find largest files

To find the largest files in a directory:

dk-ls -r -tf -pstn | dk-sort -u
Program Option Purpose
dk-ls List files.
-r Recursive listing including all subdirectories.
-tf Restrict output to files (non-directory items).
-pstn Set print order to:
  • s File size (number of bytes)
  • t File type
  • n File name
dk-sort Sort text line by line.
-u Sort by unsigned number at start of line.

Group files by file type suffix, sort by size

To list all files, group by file type suffix and sort each group by size:

dk-ls -tf -psn | dk-sort -u -t -s 1
Program Option Purpose
dk-ls List files.
-tf Restrict output to files (non-directory items).
-psn Set print order to:
  • s File size (number of bytes)
  • n File name
dk-sort Sort text line by line.
-u Sort by unsigned number at start of line.
-t Sort by file type suffix.
-s 1 To find the file type suffix, skip the first text word in each line (the size).

Find largest subdirectory

To find the largest subdirectory:

dk-ls -r -td -pstn | dk-sort -u
Program Option Purpose
dk-ls List files.
-r Recursive listing including all subdirectories.
-td Restrict output to directories.
-pstn Set print order to:
  • s File size (number of bytes)
  • t File type
  • n File name
dk-sort Sort text line by line.
-u Sort by unsigned number at start of line.

Group files by file type suffix, sort by modification time

To list all files, group by file type suffix and sort each group by modification timestamp:

dk-ls -tf -pmn | dk-sort -t -s 2
Program Option Purpose
dk-ls List files.
-tf Restrict output to files (non-directory items).
-pmn Set print order to:
  • m Modification timestamp
  • n File name
dk-sort Sort text line by line.
-t Sort by file type suffix.
-s 2 To find the file type suffix, skip the first two text words in each line (modification date and modification timestamp).

Manual

See the [dk-ls manual] for the full documentation of the program.


← Previous ↑ Home → Next

Related

Wiki: Home
Wiki: dk-ls manual