Finding Files with Perl on a Hidden Dir?

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Finding Files with Perl on a Hidden Dir?
# 8  
Old 07-01-2016
I think some clarification about "hidden files" is in order, because it seems this in first place has lead to the confusion:

"Hidden files" is a concept going back to the MS-DOS ("FAT") file system. There was an attribute in the directory entry marking a file "hiidden" (or not hidden) and all programs processing or creating file lists didn't show files with this attribute set as long as not explicitly told to do so.

There is no such concept at all in place in UNIX filesystems! In fact "ls" by convention does not display file(name)s starting with a "." unless told otherwise by the use of the "-a" switch. Still, this is only "ls" and it makes the files/directories any special at all. The whole mechanism is just to allow for the rc-files, config directories and other things one is "normally" not interested in to be filtered from display when doing an "ls". But that is no attribute inherent to the file, it is just a mechanism inside "ls".

I hope this helps.

bakunin
# 9  
Old 07-01-2016
Thank you, bakunin, for that tidbit. Wasn't sure how to refer to the dot-prefixed file and dir naming convention/scheme apart from how it is dubbed by others out here in the wild; hence the chosen title for my post.

@Aia:
Thanks for letting me know which entity(?) is being passed along to Perl in this particular situation. I'd suspected as much, but was unable to banish the offending code appendage during my learning exercises the other day.

On other points, I have a question for you: Is it better to have more or less information in any particular coding scenario? Sending commands to the system via Perl is an accepted and widespread practice; and one which could be of overall benefit to others at some junctures.

Case in point: a friend of mine is an Electrophysicist of near-retirement age who dabbles in Perl; and only recently discovered the use of backticks in passing along system commands. After our conversation, he was grateful for the information; and began his own digging in that direction. In the context of this microcosm, perfecting one's crossover capabilities in this area of Perl codewriting is, I believe, a worthy undertaking for folks from all walks who may visit here...

That being said, the personal comments in your last post came across, quite frankly, as insular and strident; particularly in light of the forum in which the OP was posted. Some who visit these pages may have to deal with that type of interaction on a regular basis in real life and in potentially serious matters; and come to unix.com to relax, learn, and pursue better things.

At any rate, all the best to you; and many thanks for the valuable contributions which you present in these forums.

Good day, all!
# 10  
Old 07-01-2016
Quote:
Originally Posted by LinQ
Thank you, bakunin, for that tidbit. Wasn't sure how to refer to the dot-prefixed file and dir naming convention/scheme apart from how it is dubbed by others out here in the wild; hence the chosen title for my post.

@Aia:
Thanks for letting me know which entity(?) is being passed along to Perl in this particular situation. I'd suspected as much, but was unable to banish the offending code appendage during my learning exercises the other day.

On other points, I have a question for you: Is it better to have more or less information in any particular coding scenario? Sending commands to the system via Perl is an accepted and widespread practice; and one which could be of overall benefit to others at some junctures.

Case in point: a friend of mine is an Electrophysicist of near-retirement age who dabbles in Perl; and only recently discovered the use of backticks in passing along system commands. After our conversation, he was grateful for the information; and began his own digging in that direction. In the context of this microcosm, perfecting one's crossover capabilities in this area of Perl codewriting is, I believe, a worthy undertaking for folks from all walks who may visit here...

That being said, the personal comments in your last post came across, quite frankly, as insular and strident; particularly in light of the forum in which the OP was posted. Some who visit these pages may have to deal with that type of interaction on a regular basis in real life and in potentially serious matters; and come to unix.com to relax, learn, and pursue better things.

At any rate, all the best to you; and many thanks for the valuable contributions which you present in these forums.

Good day, all!
Hi, LinQ

Please, do not misunderstand my point. Using the back ticks and any other facilities that Perl has to make a system call is perfectly acceptable when the need arise (apart from getting abused most of the time). My comment was referring specifically to "your" specific attempt in the while loop you shown. Using ls -a ... | grep ... (eq or ge) something in a while loop is a broken code, it does not work, even if it appears to work to you and the only way to fix it is to not use it.
Sorry, if that's not agreeable to you. Next time, I will try to remember to keep my keyboard as inactive as tits on a boar.

Last edited by Aia; 07-01-2016 at 12:16 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

2. Shell Programming and Scripting

PERL - Copying ONLY files from one dir to another

I'm writing a Perl script which has its 1st step as to copy files from one directory to another directory. The Source directory has got files with extension, without extension, directories etc. But I want to copy ONLY files with no extension. The files with extensions and directories should not get... (2 Replies)
Discussion started by: jhamaks
2 Replies

3. Shell Programming and Scripting

Hidden Characters in Regular Expression Matching Perl - Perl Newbie

I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense. ... (4 Replies)
Discussion started by: kittyluva2
4 Replies

4. Cybersecurity

Inquiry of .awo hidden dir with bin file inside .eeesync extension

Hi, Me i ask if someone knows about this hidden directory or it me knows where this dir associated with or in a program. I had and notices this .awo dir with bin files inside title 6770669_info.eeesync files in my directory. I wonder if this is associated with my backup program or any program... (0 Replies)
Discussion started by: jao_madn
0 Replies

5. Shell Programming and Scripting

Finding perl files without documentation

I have an application consisting of a number of perl files. I want to find those perl files that have no documentation yet, so I tried the following from the root level of the directory where the application resides: perldoc -r * The output is something like the following: No documentation found... (2 Replies)
Discussion started by: figaro
2 Replies

6. Shell Programming and Scripting

Issue with CD to a hidden dir

I have written a script to secure delete all files in a quarantine folder and my Trash folder. All the commands run trough Terminal via the script. The problem I am having is when I am changing the directory to the hidden Trash folder. When I do cd /Users/WatsonN/.Trash all it does is take it to... (2 Replies)
Discussion started by: WatsonN
2 Replies

7. Shell Programming and Scripting

PERL count files in a dir

Hi Guys, I need to count files in a dir which were updated yesterday. ls -lth | grep -i 'Jul 7' | wc -l The dir holds files of last 15 days and total count is as 2067476. Is it efficient to count the files using perl? I have developed the following perl script making use of system(). Can... (3 Replies)
Discussion started by: Asteroid
3 Replies

8. Shell Programming and Scripting

Finding Hidden files and protecting the folder containing hidden files from deletion

Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is: find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \; But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Discussion started by: pochaw
4 Replies

9. UNIX for Dummies Questions & Answers

Finding hidden files under mounted filesystems

I have never heard of this before but someone at work here says there is a command to find files that are under currently mounted filesystems. Does anyone know what this command is and is it available on HP-UX? (3 Replies)
Discussion started by: keelba
3 Replies
Login or Register to Ask a Question