OnlyOne
Note: New Version
This project is now redundant as it's been replaced by a 2nd version. You can still use this if you like, but the recommended version where you'll find more support will be the 2nd version.
This has been re-written in C++ with a new feature (switch) for case insensitivity and the ability to read piped stdin or from passed arguments.
New Version
https://github.com/Lateralus138/onlyonev2
About
Description
Print unique lines from a file. Similar to using something like '|sort|uniq', but without sorting.
Motivation
- I wanted a better solution than
|sort|uniqto get unique lines from a file. I use this to truncate .bash_history especially since I usefzfto search history. - I like to make my own utilities even if there are viable alternatives.
Development
This program is written in the programming language Rust and maintained, built, and tested here at this GitHub repository and pre-built and pre-tested on personal Linux and Windows machines.
Usage
This is a cross-platform command line tool in binary executable format that can be used in command lines/consoles/terminals/ttys/shells in Linux, Windows, and MacOs.
This program's name has various versions, but they should all be renamed to: onlyone.
File Permissions
The main program file is meant to be executable and in Windows that's not usually an issue, but in Linux and MacOs you may need to set the permissions.
In a Linux or MacOs command line run:
# executable for all users
chmod +x /path/to/onlyone
# or
chmod 755 /path/to/onlyone
# executable for current user only
chmod u+x /path/to/onlyone Installation
This program is portable, but there is a Debian (.deb file) package installer for the Linux binary version.
Debian Installer
The file: onlyone.deb is a Linux Debian package installer for use on most Linux Debian based operating systems.
Install By (Double) Clicking
Like many other executable files this should be able to be clicked or double clicked to execute and it should open in the systems software manager gui.
Install Command Line Method
Install from command line with:
sudo dpkg -i /path/to/onlyone.debI imagine this can be installed with gdebi, but I'm not familiar with it.
Uninstall with:
Uninstall Command Line Method
sudo apt remove onlyone
# -y to skip prompt approvalPortable Usage
Portable applications do not need to be installed, but they are easier to use if they are in one of a systems PATH directories.
If the program file is not in PATH (or in the current directory) then you must run it with the complete path url:
/path/to/onlyone --helpor
& '\Path\To\onlyone.exe' --helpIf the file is place in PATH then you can run it with:
onlyone --helpOperating System PATH
PATH directories are stored and can listed in the various operating systems PATH variable.
E.g.
echo "$PATH"| Operating System | Variable Name |
|---|---|
| Linux | $PATH |
| MacOs | $PATH |
| Windows | %PATH% |
Environment Usage
Used in many command lines across 3 main operating systems (and more).
Operating System Environment
3 main operating systems:
- Linux
- Windows
- MacOs
Command Line Environment
Used in any command line environment from Linux Shell to Windows PowerShell.
- Windows
- CMD
- PowerShell
- Linux
- Shell
- Bash
- Zsh
- many more...
- MacOs
- Same as Linux I imagine.
Examples
Get unique lines in a file:
$ # first read file.txt contents
$ cat file.txt
line 1
line 1
line 2
line 2
line 3
line 3
line 3
$ # get unique lines
$ onlyone file.txt
line 1
line 2
line 3Get unique line count:
$ cat file.txt|wc -l
9
$ onlyone file.txt|wc -l
4Help:
$ onlyone --help
Print unique lines.
E.g. onlyone /path/to/file
@USAGE:
onlyone FILE...
onlyone [OPTIONS...]...
onlyone [OPTIONS...]... FILE...
@FILE:
File Any file to read.
@OPTIONS:
-h,--help This HELP message.
@ERRORS: Integers - Exit Codes.
0 No errors.
1 No parameters passed.
2 No valid file passed.
3 Path does not exist.
4 Could not read file.
5 No lines in file.
6 Error while reading line.
Links
All links pertinent to this project.
All of the most current, up-to-date files are located on the 'Stable Release' page.
Project Links
Current project links.
| Description | Link |
|---|---|
| Main repository. | https://github.com/Lateralus138/onlyone |
| Main repository - themed version. | https://lateralus138.github.io/onlyone |
| Current Releases | https://github.com/Lateralus138/onlyone/releases |
| Stable Release | https://github.com/Lateralus138/onlyone/releases/tag/1.0.0.0 |
File Links
Current release files.
These are all the files included under 'Stable Release' on the 'Current Releases' page.
| File Name | Description | Link |
|---|---|---|
| onlyone.deb | Debian package installer. | ./target/release/onlyone.deb |
| onlyone_linux | Main Linux executable. | ./target/release/onlyone_linux |
| onlyone_darwin | Main MacOS executable. | .target/release/onlyone_darwin |
| onlyone_windows.exe | Main Windows executable. | ./target/release/onlyone_windows.exe |
Project Status
Overall Status
| Description | Status |
|---|---|
| Project Release Date | |
| Total downloads for this project | |
| Complete repository size | |
| Commits in last month | |
| Commits in last year |
Latest Version Status
| Description | Status |
|---|---|
| Release version | |
| Tag version | |
| Total downloads for current version |
Latest Build Status
| Name | Status | Code Quality |
|---|---|---|
Linux: Build/Publish |
||
Debian: Build/Publish |
||
Windows: Build/Publish |
||
Macos: Build/Publish |
Media
Logo
Screen Shots
Help Screen
Demo Screen
LICENSE
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


