Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/icholy/path

sweet & simple command line tool for dealing with paths
https://github.com/icholy/path

Last synced: 1 day ago
JSON representation

sweet & simple command line tool for dealing with paths

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
```