https://github.com/lucaslarson/samefile
⚖️ a portable, POSIX-compliant implementation of Bash’s `-ef` test, sharing a device and an inode value
https://github.com/lucaslarson/samefile
bash-ef bourne-shell hacktoberfest inode inodes oh-my-zsh-plugin ohmyzsh-plugin posix-compatible posix-compliance posix-shell same-file same-files samefile test-ef zsh-plugin zsh-plugins
Last synced: about 2 months ago
JSON representation
⚖️ a portable, POSIX-compliant implementation of Bash’s `-ef` test, sharing a device and an inode value
- Host: GitHub
- URL: https://github.com/lucaslarson/samefile
- Owner: LucasLarson
- License: other
- Created: 2021-04-14T23:18:43.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2026-04-21T13:13:01.000Z (about 2 months ago)
- Last Synced: 2026-04-21T15:19:34.344Z (about 2 months ago)
- Topics: bash-ef, bourne-shell, hacktoberfest, inode, inodes, oh-my-zsh-plugin, ohmyzsh-plugin, posix-compatible, posix-compliance, posix-shell, same-file, same-files, samefile, test-ef, zsh-plugin, zsh-plugins
- Language: Shell
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Funding: .github/funding.yml
- License: license.adoc
- Code of conduct: .github/code_of_conduct.md
- Codeowners: .github/codeowners
Awesome Lists containing this project
README
# samefile
⚖️ a portable, POSIX-compliant implementation of Bash’s `-ef` test
[](https://github.com/LucasLarson/samefile/blob/main/license.adoc)
[](https://github.com/LucasLarson/samefile/releases/latest)
[](https://github.com/LucasLarson/samefile/actions?query=workflow:"Super-Linter")
## Installation
### L337
Make sure the [executable named
`samefile`](https://github.com/LucasLarson/samefile/blob/main/bin/samefile) in
`bin/` is either
- moved into a directory in `$PATH`, or
- added to `$PATH`.
### Oh My Zsh
1. clone the repostory:
```sh
git clone --depth 1 https://github.com/LucasLarson/samefile "${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}"/plugins/samefile
```
2. Next, open the `.zshrc` file in your home directory
2. insert the word ` samefile ` between the parentheses on the line that begins
with `plugins=`.
2. save and close the file, then `source` it with `. "${HOME}"/.zshrc`.
## Usage
```sh
# not this
[ path/to/some/file -ef path/to/another/file ]
# and definitely not this
[[ path/to/some/file -ef path/to/another/file ]]
# but rather this
samefile path/to/some/file path/to/another/file
# or this
samefile --verbose path/to/some/file path/to/another/file
# or this
samefile -v path/to/some/file path/to/another/file
# returns a `0` exit status on success and `1` for failure
# just like `[`, `[[`, and `test`
```
Bash’s `-ef` and `samefile` both check that two files aren’t just similar, but
are
1. the same exact file and have
1. the same exact inode values.