List hidden files and folders

Below combination commands will list hidden files and folders. In this commands to list content ls with -A switch is use to list content of a directory and the hidden content which filename are prefix with dot (.) character for example file .profile and that output is forwarded through pipe to grep to search with pattern carat (^) and dot (.) but if you see the backslash (\) character which is a escape character and it help when it necessary to mention a character as a search pattern instead of regular expression character. The carat (^) character is use to mention starting character of a given pattern in a line and dot (.) character is use to mention any one character in regular expression.

ls -A /home/users/ | grep '^\.'

Design by SanjuD (@ngineerbabu)