I have a directory, let's say its name is direct in which has multiple files whose names are .xyz, .abc, .klm and .etk4 etc. Is there a way to make all those hidden files visible at the same time instead of one by one? I know this question has been asked before here but I did not get the answer. I hope somebody can explain it to me in a simple way since I am not much familiar with linux.

有帮助吗?

解决方案

for file in .[^.]*
do
    mv "${file}" "${file#.}"
done

${var#prefix} expands to the value of $var with the initial prefix removed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top