Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
catatsuy committed Aug 28, 2021
1 parent 4ced585 commit 04a1893
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# lls
# lls

lls is lightweight ls. Using lls, you can get a list of files in a directory that contains a large number of files.

## How?

You allocate a buffer for the size of the directory, and then call the getdents64 system call directly.

The larger the size of the directory, the more memory you will need. By running `ls -dl`, you will know how much memory to allocate in advance.

See [this article](http://be-n.com/spw/you-can-list-a-million-files-in-a-directory-but-not-with-ls.html) for more information.

## Usage

```sh
$ lls > output.txt

$ lls / > output.txt
```

If you want to reduce the memory usage, you can specify the `-buf-size` option. If the size you specify is smaller than the actual size needed, you will not get the full file list.

0 comments on commit 04a1893

Please sign in to comment.