I don't want to list recursively the sub directory as well. I have tried following but it did not worked correctly.
ls -lad ~/.*
ls -la ~/.*
I don't want to list recursively the sub directory as well. I have tried following but it did not worked correctly.
ls -lad ~/.*
ls -la ~/.*
Try:
$ ls -lA | grep ' \.'
The -A option to ls includes all hidden files, except .
and ..
.
grep, as used above finds .
(space, dot) and filters away lines that do not have that.
$ ls -lA | grep -E '^d.* \.
... lists only dirs.
$ ls -lA | grep -Ev '^d.*' | grep ' \.'
... lists only files.
... and that last can be used as alternative for files-only
$ ls -lA | grep -E '^d.*' | grep ' \.'
just remove the -v flag on grep
but it did not worked correctly
. Please elaborate. – mook765 Jun 11 '22 at 15:23