https://github.com/icholy/path
sweet & simple command line tool for dealing with paths
https://github.com/icholy/path
Last synced: 3 months ago
JSON representation
sweet & simple command line tool for dealing with paths
- Host: GitHub
- URL: https://github.com/icholy/path
- Owner: icholy
- Created: 2014-02-11T16:16:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-20T15:33:10.000Z (over 11 years ago)
- Last Synced: 2025-01-30T03:13:10.621Z (5 months ago)
- Language: Go
- Homepage:
- Size: 168 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Path
---> Simple tool for dealing with paths
```
Usage of path:
-a=false: Abs returns an absolute representation of path
-b=false: Base returns the last element of path
-c=false: Clean returns the shortest path equivalent
-d=false: Dir returns all but the last element of path
-j=false: Join joins any number of path elements into a single path
-x=false: Ext returns the file name extension used by path
```Examples:
``` sh
$ ls | path -a
/home/icholy/code/go/src/github.com/icholy/path/main.go
/home/icholy/code/go/src/github.com/icholy/path/path
/home/icholy/code/go/src/github.com/icholy/path/README.md
`````` sh
$ path -x `ls`
.go.md
`````` sh
$ find . | head -100 | path -x | grep -v '^$' | sort | unic -c
`````` sh
$ path -j `pwd` foo bar baz
/home/icholy/code/go/src/github.com/icholy/path/foo/bar/baz
```