Natively pretty printing `ls` output
There are a lot of terminal-user-interface tools for displaying files in a more intuitive way. Among them are ranger, vifm and lf.
Of course ls has lots of options to make the output more readable. My default alias is as
follows
alias l="ls -lFhG --time-style='+%F-%H%M' --group-directories-first"
where
-l uses the long format listing, displaying more information than just ls. In
particular, it displays only one file per line.
-F appends an indicator to files so they can be immediately identified. This adds a
* to executable files, / for directories, @ for symbolic links,
| for named pipes, = for sockets and > for doors.
-h displays the size of the file in a human-readable format.
-G suppresses printing group names.
--time-style='+%F-%H%M' prints the time in a specific format.
--group-directories-first lists directories first.
Now creating the file
touch ~/----------------
will give output as follows
$ l ~/
drwxr-xr-x 1 user 64 2022-01-02-1801 dir1/
drwxr-xr-x 1 user 64 2022-01-02-1801 dir2/
drwxr-xr-x 1 user 64 2022-01-02-1801 dir3/
-rw-r--r-- 1 user 0 2022-01-02-1801 ----------------
drwxr-xr-x 1 user 64 2022-01-02-1801 file
drwxr-xr-x 1 user 64 2022-01-02-1801 executable*
drwxr-xr-x 1 user 64 2022-01-02-1801 symbolic_link -> /other/destination
Of course this separator will only be in your home directory. It’s still a little fun though, and you don’t
need an external command for something as central as ls.