Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyproto/fstabfmt
:dagger: Format /etc/fstab files automatically
https://github.com/xyproto/fstabfmt
bsd filesystem format formatter fstab linux system-tools unix utility
Last synced: 6 days ago
JSON representation
:dagger: Format /etc/fstab files automatically
- Host: GitHub
- URL: https://github.com/xyproto/fstabfmt
- Owner: xyproto
- License: bsd-3-clause
- Created: 2021-03-10T14:54:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T14:20:37.000Z (3 months ago)
- Last Synced: 2025-01-08T11:07:10.235Z (14 days ago)
- Topics: bsd, filesystem, format, formatter, fstab, linux, system-tools, unix, utility
- Language: Go
- Homepage: https://fstabfmt.roboticoverlords.org
- Size: 650 KB
- Stars: 72
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Build](https://github.com/xyproto/fstabfmt/workflows/Build/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/fstabfmt)](https://goreportcard.com/report/github.com/xyproto/fstabfmt) [![License](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/fstabfmt/main/LICENSE)
Take a stab at formatting `/etc/fstab` files with `fstabfmt`.
## Features and limitations
* Can format `/etc/fstab` files.
* Will use 2 spaces between all fields, if they are of equal length.
* The shorter fields are padded with spaces.
* Other padding lengths than 2 can be supplied with the `-s` flag.## Example use
* Run `fstabfmt /etc/fstab` to see the formatted output. No changes are made to the file.
* Run `fstabfmt -s 8 /etc/fstab` to see the formatted output with 8 spaces between fields. No changes are made to the file.
* Run `fstabfmt -i /etc/fstab` to make changes to `/etc/fstab`.## Example output
Before:
```sh
# Static information about the filesystems.
# See fstab(5) for details.
#
#
# /dev/nvme0n1p2 LABEL=root
UUID=2bb3c21b-dc8f-401e-991b-66afd7301cb7 / xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 1# /dev/nvme0n1p1 LABEL=boot
UUID=1815-DD5D /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
```After:
```sh
# Static information about the filesystems.
# See fstab(5) for details.
#
## /dev/nvme0n1p2 LABEL=root
UUID=2bb3c21b-dc8f-401e-991b-66afd7301cb7 / xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 1# /dev/nvme0n1p1 LABEL=boot
UUID=1815-DD5D /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
```## General info
* Version: 1.2.0
* License: BSD-3
* Author: Alexander F. Rødseth <[email protected]>