```python
def path_clean(path: str) -> str:
    if not path:
        return path

    cleaned_path = []
    for segment in path.split('/'):
        if segment == '..':
            if cleaned_path and cleaned_path[-1] == '..':
                cleaned_path.pop()
        elif segment == '.':
            continue
        else:
            cleaned_path.append(segment)

    return '/'.join(cleaned_path)
```