UNIX: How to change all hidden folders/files to visible in a directory UNIX: How to change all hidden folders/files to visible in a directory unix unix

UNIX: How to change all hidden folders/files to visible in a directory


This worked to me:

rename 's/\.//;' .*

It looks for all files with .something and renames to something.


I am not sure why you would want to do this but you could do the following three commands

ls -a | grep "^\.[^\.]" | sed -e "s/\.\(.*\)$/mv \0 \1/" > mv_hiddenchmod +x mv_hidden./mv_hiddenrm mv_hidden

You might want to check that the list of command produce in the file mv_hidden looks correct by executing

less mv_hidden


To change all files in the current directory from hidden to non-hidden:

for f in .*; do    if [ "$f" != . -a "$f" != .. ]; then        mv "$f" "${f:1}"    fidone