Hi All,
I have directory structre as below
Code:
$ tree /tmp/OS/ -d
/tmp/OS/
|-- Linux
| |-- Debian
| | `-- test
| |-- Fedora
| |-- RedHat
| `-- Suse
| `-- test1
| `-- test2
`-- Windows
|-- Vista
`-- XP
11 directories
Now I wanted print only upto 3rd subdirectory inside /tmp. For example I wanted to get output as only below
Code:
/tmp/OS/Linux/Debian
/tmp/OS/Linux/Fedora
/tmp/OS/Linux/RedHat
/tmp/OS/Linux/Suse
/tmp/OS/Windows/Vista
/tmp/OS/Windows/XP
and wanted hide everything which are lesser than or greter than 4th directory. For that I ran
Code:
$ find /tmp/OS/ -maxdepth 2 -type d | sort
/tmp/OS/
/tmp/OS/Linux
/tmp/OS/Linux/Debian
/tmp/OS/Linux/Fedora
/tmp/OS/Linux/RedHat
/tmp/OS/Linux/Suse
/tmp/OS/Windows
/tmp/OS/Windows/Vista
/tmp/OS/Windows/XP
Since I am getting output as above how can I hide these below?
Code:
/tmp/OS/
/tmp/OS/Linux
/tmp/OS/Windows
Please help me.