This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a manual page, thus deprecating `-h` and `-v` options. - Fix type idenfication of socket files. - Ported code to C90 standard.
- Loading branch information
Showing
4 changed files
with
318 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Reveal (rvl) | ||
A program that reveals info about file system entries on Linux. | ||
|
||
## Requirements | ||
In order to build it, you will only need a C90 compiler, like `tcc`. | ||
|
||
## Installation | ||
- Compile the file `rvl.c`. | ||
|
||
```bash | ||
mkdir -p ~/.local/bin | ||
tcc -o ~/.local/bin/rvl rvl.c | ||
``` | ||
|
||
- Install the manual page `rvl.1`. | ||
|
||
```bash | ||
mkdir -p ~/.local/share/man/man1 | ||
cp rvl.1 ~/.local/share/man/man1 | ||
``` | ||
|
||
If necessary, add the `~/.local/bin` and `~/.local/share/man/man1` directories | ||
to your system `PATH` and `MANPATH` environment variables, respectively, in | ||
order to be able to access their files directly. | ||
|
||
```bash | ||
export PATH=${PATH}:~/.local/bin | ||
export MANPATH=${MANPATH}:~/.local/share/man/man1 | ||
``` | ||
|
||
## Documentation | ||
Once installed, you can read its manual. | ||
|
||
```bash | ||
man rvl.1 | ||
``` | ||
|
||
## Copyright | ||
See `LICENSE` for copyright and license details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
.TH RVL 1 v16.2.0 RVL | ||
.SH NAME | ||
rvl - reveals info about file system entries. | ||
|
||
.SH SYNOPSIS | ||
rvl [\fIOPTION\fP | \fIPATH\fP]... | ||
|
||
.SH DESCRIPTION | ||
It reveals info about each entry PATH(s) given as arguments. Use its OPTION(s) | ||
before them for custom readings. Mix them together to obtain various results at | ||
once. | ||
|
||
.SH DATA TYPE OPTIONS | ||
Use these options before entry paths to set the data type to be retrieved. If | ||
none is used, the one marked as default is considered. | ||
|
||
.TP | ||
.B \-c | ||
(default) reveal its contents. For files, it will be their contents, and for | ||
directories, their entries. | ||
.TP | ||
.B \-t | ||
reveals its type: regular (r), directory (d), symlink (l), character (c), | ||
block (b), socket (s) or fifo (f). | ||
.TP | ||
.B \-s | ||
reveals its byte size. | ||
.TP | ||
.B \-hs | ||
reveals its size using the most convenient unit for a human read. | ||
.TP | ||
.B \-p | ||
reveals its read (r), write (w), execution (x) and lack (-) permissions for | ||
user, group and others. | ||
.TP | ||
.B \-op | ||
reveals its permissions in octal base. | ||
.TP | ||
.B \-u | ||
reveals the user that owns it. | ||
.TP | ||
.B \-ui | ||
reveals the UID of the user that owns it. | ||
.TP | ||
.B \-g | ||
reveals the group that owns it. | ||
.TP | ||
.B \-gi | ||
reveals the GID of the group that owns it. | ||
.TP | ||
.B \-md | ||
reveals its last modified date. | ||
|
||
.SH SYMLINK OPTIONS | ||
Use these options before entry paths to set how symlinks are handled. If | ||
none is used, the one marked as default is considered. | ||
|
||
.TP | ||
.B \-ul | ||
(default) unfollows symlinks. | ||
.TP | ||
.B \-fl | ||
follows symlinks. | ||
|
||
.SH EXAMPLES | ||
|
||
# reveals the entries in the current directory. | ||
.br | ||
rvl . | ||
|
||
# reveals the type of some unknown entries. | ||
.br | ||
rvl -t ../entry{1,2} | ||
|
||
# reveals the permissions of a file and current directory. | ||
.br | ||
rvl -p file.txt -op . | ||
|
||
# combine it with wildcards and utilities. | ||
.br | ||
rvl -t ~/.* | ||
.br | ||
rvl /usr/bin | fmt | ||
.br | ||
date --date="$(rvl -md file.conf)" +"%H:%M" | ||
|
||
.SH EXIT STATUS | ||
It returns 0 on success, and 1 otherwise. | ||
|
||
.SH SOURCE CODE | ||
Its source code is available at <https://github.com/skippyr/rvl>. | ||
|
||
.SH BUGS | ||
Report bugs at <https://github.com/skippyr/rvl/issues>. | ||
|
||
.SH SEE ALSO | ||
.BR cat (1), | ||
.BR dir (1), | ||
.BR find (1), | ||
.BR ls (1), | ||
.BR lsblk (1), | ||
.BR readlink (1) | ||
|
||
.SH COPYRIGHT | ||
MIT License. | ||
.br | ||
Copyright (c) 2023 Sherman Rofeman <skippyr.developer@gmail.com>. | ||
|
||
See LICENSE for copyright and license details. |
Oops, something went wrong.