1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00
Files
til/unix/list-files-in-a-single-column.md
2024-03-27 17:21:54 -05:00

35 lines
921 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# List Files In A Single Column
The `ls` command lists out the files and directories in your current directory
or a specified directory.
The standard output for an `ls` command expands the fit the width of your
terminal screen.
```bash
ls *.(ts|js)
cypress.config.ts postcss.config.js remix.config.js remix.env.d.ts server.ts tailwind.config.ts vitest.config.ts
```
This might not always be the ideal way to view that output. For instance, the
above example when shared as a code block like in this post ends up with
horizontal scroll.
With the `-1` flag, we can tell `ls` to display the results in a single
vertical column.
```bash
ls -1 *.(ts|js)
cypress.config.ts
postcss.config.js
remix.config.js
remix.env.d.ts
server.ts
tailwind.config.ts
vitest.config.ts
```
See `man ls` for more details.
[source](https://askubuntu.com/questions/954924/listing-files-in-directory-in-one-column)