-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
132 additions
and
0 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
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,58 @@ | ||
.Dd Sep 11, 2024 | ||
.Dt READLINK 1 | ||
.Os | ||
.Sh NAME | ||
.Nm readlink | ||
.Nd print symbolic link targets or canonical file names | ||
.Sh SYNOPSIS | ||
.Nm | ||
.Op Ar OPTION... | ||
.Op Ar path... | ||
.Sh DESCRIPTION | ||
The | ||
.Nm | ||
utility by default reads and prints symbolic link names. | ||
It can additionally canonicalize paths, but in general | ||
.Nm realpath | ||
should be preferred for that. | ||
.Pp | ||
The options are as follows: | ||
.Bl -tag -width indent | ||
.It Fl f, e, -canonicalize, -canonicalize-existing | ||
Instead of reading link target, canonicalize | ||
.Ar path | ||
similarly to the | ||
.Nm readlink | ||
utility. All components must exist. | ||
.It Fl m, -canonicalize-missing | ||
Like above, but no components must exist. | ||
.It Fl n, no-newline | ||
Do not output the trailing newline. This is ignored if | ||
there are multiple inputs. | ||
.It Fl q, s, -quiet, -silent | ||
Most error messages are suppressed. The return failure code is still issued. | ||
This is the default. | ||
.It Fl v, -verbose | ||
Do not suppress error messages. | ||
.It Fl z, -zero | ||
By default, newlines are used to end each output line. With this flag, | ||
NUL is used instead. | ||
.It Fl -help | ||
Display a help message and exit. | ||
.It Fl -version | ||
Display version information and exit. | ||
.Sh EXIT STATUS | ||
.Ex -std | ||
.Sh SEE ALSO | ||
.Xr readlink 3 , | ||
.Xr realpath 1 | ||
.Sh HISTORY | ||
On | ||
.Fx | ||
this utility is a special invocation of | ||
.Xr stat 1 | ||
and first appeared in | ||
.Fx 4.10 . | ||
This implementation is a part of chimerautils and is a special | ||
invocation of | ||
.Xr realpath 1 . |
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,71 @@ | ||
.Dd Sep 11, 2024 | ||
.Dt REALPATH 1 | ||
.Os | ||
.Sh NAME | ||
.Nm realpath | ||
.Nd print the resolved path | ||
.Sh SYNOPSIS | ||
.Nm | ||
.Op Ar OPTION... | ||
.Op Ar path... | ||
.Sh DESCRIPTION | ||
The | ||
.Nm | ||
utility resolve all symbolic links, extra | ||
.Ql / | ||
characters and references to | ||
.Pa /./ | ||
and | ||
.Pa /../ | ||
in | ||
.Ar path . | ||
If | ||
.Ar path | ||
is absent, the current working directory | ||
.Pq Sq Pa .\& | ||
is assumed. | ||
.Pp | ||
By default, all components of | ||
.Ar path | ||
must exist. | ||
.Pp | ||
The options are as follows: | ||
.Bl -tag -width indent | ||
.It Fl f, -canonicalize-existing | ||
All components must exist. This is the default behavior. | ||
.It Fl m, -canonicalize-missing | ||
No component of the | ||
.Ar path | ||
must exist. It is resolved up until the first component that exists | ||
and a normalized path is printed. | ||
.It Fl s, -strip, -no-symlinks | ||
The | ||
.Ar path | ||
is normalized logically, without resolving any symlinks. | ||
.It Fl q, -quiet | ||
Most error messages are suppressed. The return failure code is still issued. | ||
.It Fl z, -zero | ||
By default, newlines are used to end each output line. With this flag, | ||
NUL is used instead. | ||
.It Fl -help | ||
Display a help message and exit. | ||
.It Fl -version | ||
Display version information and exit. | ||
.Sh EXIT STATUS | ||
.Ex -std | ||
.Sh EXAMPLES | ||
Show the physical path of the | ||
.Pa /dev/log | ||
directory silencing warnings if any: | ||
.Bd -literal -offset indent | ||
$ realpath -q /dev/log | ||
/var/run/log | ||
.Ed | ||
.Sh SEE ALSO | ||
.Xr realpath 3 | ||
.Sh HISTORY | ||
The | ||
.Nm | ||
utility first appeared in | ||
.Fx 4.3 . | ||
This implementation is a part of chimerautils and was written from scratch. |