dktools - Dirk Krauses tools Wiki
Drawing, graphics conversion, software development, administration.
Brought to you by:
kraused
← Previous | ↑ Home | → Next |
The program sorts input text from the specified files (or from standard input if no file is specified) line by line.
There are some differences to traditional sort programs:
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:
|
|
dk-sort | Sort text line by line alphabetically. |
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:
|
|
dk-sort | Sort text line by line. | |
-u | Sort by unsigned number at start of line. |
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:
|
|
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). |
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:
|
|
dk-sort | Sort text line by line. | |
-u | Sort by unsigned number at start of line. |
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:
|
|
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). |
See the [dk-sort manual] for the full documentation of the program.
← Previous | ↑ Home | → Next |