Home Explore Blog CI



nushell

7th chunk of `blog/2019-08-23-introducing-nushell.md`
4c930dd41c9d5243274e474ddf08f04e50f8d311a507b9760000000100000fb8
 10 | -rw-r--r-- | 1       |  sophia  |  sophia  | 148     | Jun     | 17      | 15:32   | .editorconfig
 11 | drwxr-xr-x | 4       |  sophia  |  sophia  | 4096    | Aug     | 22      | 19:29   | extra
 12 | drwxr-xr-x | 8       |  sophia  |  sophia  | 4096    | Aug     | 24      | 03:24   | .git
 13 | -rw-r--r-- | 1       |  sophia  |  sophia  | 58      | Aug     | 10      | 11:08   | .gitignore
 14 | drwxr-xr-x | 2       |  sophia  |  sophia  | 4096    | Aug     | 24      | 03:24   | images
 15 | -rw-r--r-- | 1       |  sophia  |  sophia  | 1085    | Jun     | 17      | 15:32   | LICENSE
 16 | -rw-r--r-- | 1       |  sophia  |  sophia  | 614     | Jun     | 17      | 15:32   | Makefile.toml
 17 | -rw-r--r-- | 1       |  sophia  |  sophia  | 0       | Aug     | 23      | 04:58   | open
 18 | -rw-r--r-- | 1       |  sophia  |  sophia  | 11375   | Aug     | 24      | 03:24   | README.md
 19 | -r--r--r-- | 1       |  sophia  |  sophia  | 0       | Jul     | 4       | 03:51   | readonly.txt
 20 | -rw-r--r-- | 1       |  sophia  |  sophia  | 37      | Aug     | 23      | 04:54   | rustfmt2.toml
 21 | -rw-r--r-- | 1       |  sophia  |  sophia  | 16      | Aug     | 1       | 19:45   | rustfmt.toml
 22 | drwxr-xr-x | 10      |  sophia  |  sophia  | 4096    | Aug     | 24      | 03:24   | src
 23 | drwxr-xr-x | 4       |  sophia  |  sophia  | 4096    | Aug     | 22      | 19:22   | target
 24 | drwxr-xr-x | 4       |  sophia  |  sophia  | 4096    | Aug     | 22      | 04:15   | tests
 25 | drwxrwxr-x | 2       |  sophia  |  sophia  | 4096    | Jul     | 19      | 15:18   | .vscode
----+------------+---------+----------+----------+---------+---------+---------+---------+---------------
```

After a bit of experimenting, we might come up with a command like this:

```
> ^ls -la | lines | skip 1 | split-column " " perms files group user size month day time name
----+------------+-------+----------+----------+--------+-------+-----+-------+---------------
 #  | perms      | files | group    | user     | size   | month | day | time  | name
----+------------+-------+----------+----------+--------+-------+-----+-------+---------------
 0  | drwxr-xr-x | 13    |  sophia  |  sophia  | 4096   | Aug   | 24  | 03:24 | .
 1  | drwxr-xr-x | 21    |  sophia  |  sophia  | 4096   | Aug   | 22  | 17:00 | ..
 2  | drwxr-xr-x | 2     |  sophia  |  sophia  | 4096   | Aug   | 3   | 05:39 | assets
 3  | drwxr-xr-x | 2     |  sophia  |  sophia  | 4096   | Aug   | 21  | 19:29 | .azure
 4  | drwxr-xr-x | 2     |  sophia  |  sophia  | 4096   | Jun   | 23  | 05:09 | .cargo
 5  | -rw-r--r-- | 1     |  sophia  |  sophia  | 2963   | Aug   | 22  | 20:17 | Cargo2.toml
 6  | -rw-r--r-- | 1     |  sophia  |  sophia  | 201255 | Aug   | 24  | 03:24 | Cargo.lock
 7  | -rw-r--r-- | 1     |  sophia  |  sophia  | 3127   | Aug   | 24  | 03:24 | Cargo.toml
 8  | drwxr-xr-x | 2     |  sophia  |  sophia  | 4096   | Jun   | 17  | 15:32 | docs
 9  | -rw-r--r-- | 1     |  sophia  |  sophia  | 148    | Jun   | 17  | 15:32 | .editorconfig
 10 | drwxr-xr-x | 4     |  sophia  |  sophia  | 4096   | Aug   | 22  | 19:29 | extra
 11 | drwxr-xr-x | 8     |  sophia  |  sophia  | 4096   | Aug   | 24  | 03:24 | .git
 12 | -rw-r--r-- | 1     |  sophia  |  sophia  | 58     | Aug   | 10  | 11:08 | .gitignore
 13 | drwxr-xr-x | 2     |  sophia  |  sophia  | 4096   | Aug   | 24  | 03:24 | images
 14 | -rw-r--r-- | 1     |  sophia  |  sophia  | 1085   | Jun   | 17  | 15:32 | LICENSE
 15 | -rw-r--r-- | 1     |  sophia  |  sophia  | 614    | Jun   | 17  | 15:32 | Makefile.toml
 16 | -rw-r--r-- | 1     |  sophia  |  sophia  | 0      | Aug   | 23  | 04:58 | open
 17 | -rw-r--r-- | 1     |  sophia  |  sophia  | 11375  | Aug   | 24  | 03:24 | README.md
 18 | -r--r--r-- | 1     |  sophia  |  sophia  | 0      | Jul   | 4   | 03:51 | readonly.txt
 19 | -rw-r--r-- | 1     |  sophia  |  sophia  | 37     | Aug   | 23  | 04:54 | rustfmt2.toml
 20 | -rw-r--r-- | 1     |  sophia  |  sophia  | 16     | Aug   | 1   | 19:45 | rustfmt.toml

Title: Parsing `ls -la` Output with Nu: Refining Column Splitting
Summary
The text continues to demonstrate how to parse the output of the `ls -la` command in Nushell. It refines the process by skipping the first line (total line) and then splitting the remaining lines into named columns such as permissions, file count, group, user, size, month, day, time, and name, providing a structured view of the directory contents.