Let's say I have a sorted list of absolute paths, like the one in my answer [here](https://askubuntu.com/a/864572/367990) (shortened and modified for this question):

```
/proc
/proc/sys/fs/binfmt_misc
/proc/sys/fs/binfmt_misc
/run
/run/cgmanager/fs
/run/hugepages/kvm
/run/lock
/run/user/1000
/run/user/1000/gvfs
/tmp
/home/bytecommander/ramdisk

```

What I want is to reduce this list by eliminating all paths which are subdirectories of previously mentioned paths. That means, for the given input I want this output:

```
/proc
/run
/tmp
/home/bytecommander/ramdisk

```

How can this be done easily in the command-line using e.g. Bash, `sed`, `awk` or any other common tools? Short solutions that fit in one line are appreciated but not required.