Home > Server Administration > Linux Server Tips > Show Hidden Files
Show Hidden Files
By default linux ls or ls -l do not show Hidden files.
Hidden files are files that start with dot in file name. Some example hidden files are ".htaccess", ".history", etc...
Any Files start with . are hidden files in Linux
To see hidden files, you have to use "ls -la"
In Following example, ls shows only one files, others are hidden.
# ls -l
total 16
-rw-r--r-- 1 root root 15864 2006-07-10 14:26 index.html
#
"ls -a" shows all files in the folder
# ls -la
total 68
drwxr-xr-x 3 root root 4096 2006-07-20 04:55 .
drwxr-xr-x 21 root root 4096 2006-07-18 12:50 ..
drwx------ 2 root root 4096 2006-07-10 07:16 .aptitude
-rw------- 1 root root 33 2006-07-19 14:24 .bash_history
-rw-r--r-- 1 root root 2227 2005-10-13 04:04 .bashrc
-rw-r--r-- 1 root root 15864 2006-07-10 14:26 index.html
-rw------- 1 root root 35 2006-07-16 07:13 .lesshst
-rw-r--r-- 1 root root 90 2006-07-15 15:41 .mailcap
-rw-r--r-- 1 root root 230 2006-07-15 15:41 .mime.types
-rw------- 1 root root 261 2006-07-19 13:52 .mysql_history
-rw-r--r-- 1 root root 141 2005-10-13 04:04 .profile
-rw------- 1 root root 1024 2006-07-10 14:39 .rnd
-rw------- 1 root root 6794 2006-07-20 04:55 .viminfo
#
FreeBSD and UNIX servers always show hidden files. You can set Linux always show hidden files. To do this add "alias ls='ls -la'" to /root/.bashrc
# cd /root
# vi .bashrc
Add line
alias ls='ls -la'
Now log off and relogin, ls and ls -l will now considered as "ls -la"
|