{"id":20826937,"url":"https://github.com/mklement0/rreadlink","last_synced_at":"2025-12-27T07:38:23.448Z","repository":{"id":27194352,"uuid":"30664672","full_name":"mklement0/rreadlink","owner":"mklement0","description":"A multi-platform Unix CLI that prints a symlink's complete chain of targets using absolute paths.","archived":false,"fork":false,"pushed_at":"2022-12-27T13:55:18.000Z","size":49,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-19T05:17:10.649Z","etag":null,"topics":["cli","filesystem","filesystem-path","symlink","unix-cli"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mklement0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T19:11:41.000Z","updated_at":"2024-12-18T13:53:32.000Z","dependencies_parsed_at":"2023-01-14T06:11:55.364Z","dependency_job_id":null,"html_url":"https://github.com/mklement0/rreadlink","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklement0%2Frreadlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklement0%2Frreadlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklement0%2Frreadlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklement0%2Frreadlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mklement0","download_url":"https://codeload.github.com/mklement0/rreadlink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243174438,"owners_count":20248310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","filesystem","filesystem-path","symlink","unix-cli"],"created_at":"2024-11-17T23:10:33.442Z","updated_at":"2025-12-27T07:38:23.399Z","avatar_url":"https://github.com/mklement0.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/rreadlink.svg)](https://npmjs.com/package/rreadlink) [![license](https://img.shields.io/npm/l/rreadlink.svg)](https://github.com/mklement0/rreadlink/blob/master/LICENSE.md)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n**Contents**\n\n- [rreadlink \u0026mdash; introduction](#rreadlink-\u0026mdash-introduction)\n- [Examples](#examples)\n- [Installation](#installation)\n  - [Installation from the npm registry](#installation-from-the-npm-registry)\n  - [Manual installation](#manual-installation)\n- [Usage](#usage)\n- [License](#license)\n  - [Acknowledgements](#acknowledgements)\n  - [npm dependencies](#npm-dependencies)\n- [Changelog](#changelog)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# rreadlink \u0026mdash; introduction\n\n`rreadlink` is a **multi-platform Unix CLI** that **prints a symlink's _complete chain_ of targets** using **_absolute_ paths**; it can\nalso determine the canonical path of non-symlinks.\n\nThe primary purpose of `rreadlink` (*r*ecursive *readlink*) is to follow a given symlink to its ultimate target, printing _all intermediate symlinks_ along the way.  \nAll paths are printed as _absolute_ paths, with the ultimate target printed in _canonical_ form.\n\nThis is hepful on Linux platforms, for instance, where some utilities are installed as symlinks that point to _other_ symlinks before resolving\nto the ultimate target, making it difficult to understand what is ultimately invoked;  \ne.g., on some Linux distros `/usr/bin/nawk` links to `/etc/alternatives/nawk`, which in turn links to the actual target, `/usr/bin/gawk`.  \nNote that the native GNU `readlink` utility can either only give you the _next_ target (not the ultimate one), or, with `-f` or `-e` or `-m`,\n_only_ the _ultimate_ target (not intermediate ones).\n\nLoosely speaking, `rreadlink` provides the functionality of GNU `readlink -e` while also including _intermediate_ targets.\n`rreadlink` has the added advantage of being multi-platform (see [Installation](#installation) below).\n\nAlternatively, given a _non_-symlink, `rreadlink` prints the argument's canonical path (i.e., any _directory_ components that are symlinks\nare resolved to their ultimate targets).\n\nFind examples below, concise [usage information](#usage) further below, or\nread the [manual](doc/rreadlink.md).\n\n\u003csup\u003e**See also**: The [`typex`](https://github.com/mklement0/typex) utility\nprovides information about _executables in the path_ (among other things) and\nhas `rreadlink`'s behavior built in to show what file is ultimately invoked.\u003c/sup\u003e\n\n# Examples\n\n```shell\n# Print the symlink chain for executable /usr/bin/nawk (e.g., on Ubuntu):\n$ rreadlink /usr/bin/nawk\n/usr/bin/nawk@ -\u003e /etc/alternatives/nawk@ -\u003e /usr/bin/gawk\n\n# Ditto, but printing one path per line, without the symlink sigil (@):\n# (This format is the default when not outputting to a terminal.)\n$ rreadlink -1 /usr/bin/nawk\n/usr/bin/nawk\n/etc/alternatives/nawk\n/usr/bin/gawk\n\n# Canonicalize the path of a non-symlink:\n# (Assume that /var links to /private/var and that log is a regular file.)\n$ rreadlink /var/log\n/private/var/log\n```\n\n# Installation\n\n**Supported platforms**\n\n**Unix-like platforms** with **POSIX-compatible utilities** and\n[Bash](http://www.gnu.org/software/bash/), such as Linux and OS X.\n\n## Installation from the npm registry\n\n\u003csup\u003eNote: Even if you don't use Node.js, its package manager, `npm`, works across platforms and is easy to install; try [`curl -L http://git.io/n-install | bash`](https://github.com/mklement0/n-install)\u003c/sup\u003e\n\nWith [Node.js](http://nodejs.org/) or [io.js](https://iojs.org/) installed, install [the package](https://www.npmjs.com/package/rreadlink) as follows:\n\n    [sudo] npm install rreadlink -g\n\n**Note**:\n\n* Whether you need `sudo` depends on how you installed Node.js / io.js and whether you've [changed permissions later](https://docs.npmjs.com/getting-started/fixing-npm-permissions); if you get an `EACCES` error, try again with `sudo`.\n* The `-g` ensures [_global_ installation](https://docs.npmjs.com/getting-started/installing-npm-packages-globally) and is needed to put `rreadlink` in your system's `$PATH`.\n\n## Manual installation\n\n* Download [the CLI](https://raw.githubusercontent.com/mklement0/rreadlink/stable/bin/rreadlink) as `rreadlink`.\n* Make it executable with `chmod +x rreadlink`.\n* Move it or symlink it to a folder in your `$PATH`, such as `/usr/local/bin` (OSX) or `/usr/bin` (Linux).\n\n\n# Usage\n\nFind concise usage information below; for complete documentation, read the [manual online](doc/rreadlink.md) or,\nonce installed, run `rreadlink nws` (`rreadlink --man` if installed manually).\n\n\u003c!-- DO NOT EDIT THE FENCED CODE BLOCK and RETAIN THIS COMMENT: The fenced code block below is updated by `make update-readme/release` with CLI usage information. --\u003e\n\n```nohighlight\n$ rreadlink --help\n\n\nRecursively resolves symlinks by printing the chain of targets using absolute  \npaths or prints the canonical path of a symlink's ultimate target or of a  \nnon-symlink.\n\n    rreadlink [-s|-1] symLink\n    rreadlink -e symLink\n\n    -s     single-line output format using ' -\u003e ' between paths and\n           @ to mark symlinks (default when printing to terminal)\n    -1     one-line-per-path output format, without the @ marker (default\n           when NOT printing to a terminal)\n    -e     print only the symlink's ultimate target, in canonical form\n\nStandard options: --help, --man, --version, --home\n```\n\n\u003c!-- DO NOT EDIT THE NEXT CHAPTER and RETAIN THIS COMMENT: The next chapter is updated by `make update-readme/release` with the contents of 'LICENSE.md'. ALSO, LEAVE AT LEAST 1 BLANK LINE AFTER THIS COMMENT. --\u003e\n\n# License\n\nCopyright (c) 2015 Michael Klement \u003cmklement0@gmail.com\u003e (http://same2u.net),\nreleased under the [MIT license](https://spdx.org/licenses/MIT#licenseText).\n\n## Acknowledgements\n\nThis project gratefully depends on the following open-source components, according to the terms of their respective licenses.\n\n[npm](https://www.npmjs.com/) dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: `(D)` denotes a development-time-only dependency, `(O)` an optional dependency, and `(P)` a peer dependency.\n\n\u003c!-- DO NOT EDIT THE NEXT CHAPTER and RETAIN THIS COMMENT: The next chapter is updated by `make update-readme/release` with the dependencies from 'package.json'. ALSO, LEAVE AT LEAST 1 BLANK LINE AFTER THIS COMMENT. --\u003e\n\n## npm dependencies\n\n* [doctoc (D)](https://github.com/thlorenz/doctoc)\n* [json (D)](https://github.com/trentm/json)\n* [marked-man (D)](https://github.com/kapouer/marked-man#readme)\n* [replace (D)](https://github.com/harthur/replace)\n* [semver (D)](https://github.com/npm/node-semver#readme)\n* [shall (D)](https://github.com/mklement0/shall)\n* [urchin (D)](https://git.sdf.org/tlevine/urchin)\n\n\u003c!-- DO NOT EDIT THE NEXT CHAPTER and RETAIN THIS COMMENT: The next chapter is updated by `make update-readme/release` with the contents of 'CHANGELOG.md'. ALSO, LEAVE AT LEAST 1 BLANK LINE AFTER THIS COMMENT. --\u003e\n\n# Changelog\n\nVersioning complies with [semantic versioning (semver)](http://semver.org/).\n\n\u003c!-- NOTE: An entry template is automatically added each time `make version` is called. Fill in changes afterwards. --\u003e\n\n* **[v0.2.1](https://github.com/mklement0/rreadlink/compare/v0.2.0...v0.2.1)** (2015-10-21):\n  * [dev] Improved robustness of interal `rreadlinkchain()` function.\n\n* **[v0.2.0](https://github.com/mklement0/rreadlink/compare/v0.1.6...v0.2.0)** (2015-09-18):\n  * [potentially breaking change] `rreadlink` now also accepts options placed\n      _after_ operands on the command line (except after `--`).\n  * [doc] `rreadlink` now has a man page (if manually installed, \n      use `rreadlink --man`); `rreadlink -h` now just prints concise usage\n      information.\n  * [doc] `README.md` cleaned up and extended.\n  * [dev] Removed post-install command that verifies presence of Bash, because\n    `npm` _prints_ the command during installation, which can be confusing.\n\n* **[v0.1.6](https://github.com/mklement0/rreadlink/compare/v0.1.5...v0.1.6)** (2015-09-15):\n  * [dev] Makefile improvements; various other behind-the-scenes tweaks.\n\n* **[v0.1.5](https://github.com/mklement0/rreadlink/compare/v0.1.4...v0.1.5)** (2015-06-26):\n  * [doc] Read-me: npm badge changed to shields.io; license badge added; typo fixed.\n  * [dev] To-do added; Makefile updated.\n\n* **v0.1.4** (2015-05-30):\n  * [doc] [npm registry badge](https://badge.fury.io) added.\n\n* **v0.1.3** (2015-02-11):\n  * Doc: Read-me improvements.\n\n* **v0.1.2** (2015-02-11):\n  * Doc: Read-me and CLI help improvements.\n\n* **v0.1.1** (2015-02-11):\n  * Dev: Tests improved.\n\n* **v0.1.0** (2015-02-11):\n  * Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmklement0%2Frreadlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmklement0%2Frreadlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmklement0%2Frreadlink/lists"}