unhide unix files in SOLARIS

Greetings,
I have a SOLARIS UNIX folder that has files, both hidden and visible

[root@hermes test]# ls -Al
total 0
-rw-r--r--. 1 root root 0 Oct  9 09:48 .test1
-rw-r--r--. 1 root root 0 Oct  9 09:48 .test2
-rw-r--r--. 1 root root 0 Oct  9 09:57 test3
-rw-r--r--. 1 root root 0 Oct  9 09:57 test4
[root@hermes test]#

Open in new window


Is there a way, in a bash script to "unhide" test1 and test2?
Thanks.
LVL 9
Evan CutlerVolunteer Chief Information OfficerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Rename them from .test1 to test1 and similarly for .test2.
0
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Greetings,
Thank you so much,
What I'm looking to do is try to this en masse in a shell script.
So, let's say I have four hidden files, I need to "unhide" all four in a script.
The filenames are dynamic.

Thanks
0
arnoldCommented:
Before going any further, what is the issue you are looking to address?


Here is an example.
ls -a| grep '^\.'| sed -e 's/^.//' | while read a; do
mv ".$a" "$a"
done
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

skullnobrainsCommented:
rename in batch

find . -name .\* | sed 's,^\(.*\)/\.\([^/]*\)$,mv "\1/.\2" "\1/\2",' | sh

but renaming hidden files might break lots of working stuff and instructing your file browser to display hidden files is trivial. likewise you can alias ls="ls -a" so hidden files are not hidden any more on the command line.
0
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
so I have a folder, where another machine drops files into that folder.
It's the first line of defense for receiving files as the machine is from an outside entity.

For some reason, we are receiving hidden files from that machine.
files that start with the period(.).

.test1
.test2
test3, etc....

This folder is where I do checks to see what I want to process, and throw out the rest.
most commands ignore the hidden files.

I want to make sure they are not something I shouldn't have...
therefor, I need to "unhide" those, so I can do my work against them.

That's what's going on....on SOLARIS
Thanks
0
skullnobrainsCommented:
most commands ignore the hidden files

yes : but they usually provide switches that will instruct them not to ignore hidden files

if needed i'll help you to figure out how to change any existing code to deal with hidden files properly

if not, both arnold and myself gave proper batch renaming code that will work properly on solaris. ask if there is anything these commands do that you do not understand or post back if something does not work as expected including which solaris version and which shell you are using. both are supposed to be run in the directory where those files reside. mine is recursive.
0
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Thank you very much.
I will go ahead and award points on this.
If I have further questions, I will as for more.
0
skullnobrainsCommented:
feel free to post in this thread if they relate
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.