Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

How to check for hidden file

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-05-2007
Raynon Raynon is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 18 April 2011, 3:56 AM EDT
Location: Sg
Posts: 353
Thanks: 0
Thanked 2 Times in 2 Posts
How to check for hidden file

Hi All,

Is there hidden files somewhere here since it's showing "total 16", but no files being revealed ?


$ ls -la
total 16
8 drwxrwxrwx 2 zzz yyy 4096 Apr 26 12:00 ./
8 drwxrwxrwx 9 zzz yyy 4096 Jul 31 16:59 ../
$
Sponsored Links
    #2  
Old Unix and Linux 09-05-2007
younggun younggun is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 21 March 2008, 5:23 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
It shown that the hidden files occupied 16 Byte space.
Sponsored Links
    #3  
Old Unix and Linux 09-05-2007
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
 
Join Date: Aug 2007
Last Activity: 2 October 2012, 1:31 PM EDT
Location: Bangalore
Posts: 390
Thanks: 0
Thanked 0 Times in 0 Posts
the hidden files start with a . like
.raynon
.asdf
.dfhg

these are hidden files.If you want to see this you have to put
ls -al

it will show u all the files including the hidden files.
But the first two lines that is
./
../

they shows the link to current directory and the parent directory respectively.when we create a directory these two links are created automatically.

total 16 means the directory is taking 16 blocks of memory.

Thanks
Namish
    #4  
Old Unix and Linux 09-05-2007
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 27 April 2015, 10:26 AM EDT
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 447 Times in 264 Posts
Quote:
Originally Posted by namishtiwari View Post

total 16 means the directory is taking 16 blocks of memory.
Almost. Linux The 16 means that all of the entries add up to 16. There are two entries, one for the parent directory and one for the current directory. Each of these directories is using 8 blocks. If this directory was removed only 8 blocks would be recovered. The parent directory would continue to exist and continue to consume the other 8 blocks. You can see the 8 in the original directory listing posted above. Although the user seems to have entered the command "ls -la", we see the result that we would get with "ls -las". I guess an alias or a function is in use providing that s switch.
Sponsored Links
    #5  
Old Unix and Linux 09-05-2007
Raynon Raynon is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 18 April 2011, 3:56 AM EDT
Location: Sg
Posts: 353
Thanks: 0
Thanked 2 Times in 2 Posts
Hi Perderabo,

Can i find out where is the hidden file / or alias / or function is placed?

$ ls -las
total 16
8 drwxrwxrwx 2 zzz yyy 4096 Apr 26 12:00 ./
8 drwxrwxrwx 9 zzz yyy 4096 Jul 31 16:59 ../
$
Sponsored Links
    #6  
Old Unix and Linux 09-05-2007
cfajohnson's Unix or Linux Image
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
 
Join Date: Mar 2007
Last Activity: 27 May 2015, 5:40 PM EDT
Location: Toronto, Canada
Posts: 2,883
Thanks: 0
Thanked 119 Times in 107 Posts
Quote:
Originally Posted by Raynon View Post
Hi Perderabo,

Can i find out where is the hidden file / or alias / or function is placed?

$ ls -las
total 16
8 drwxrwxrwx 2 zzz yyy 4096 Apr 26 12:00 ./
8 drwxrwxrwx 9 zzz yyy 4096 Jul 31 16:59 ../
$

The 16 blocks refers to the parent directory (..).

Many versions of ls have the -A option as well as -a; try that:


Code:
$ ls -las
total 1972
   4 drwxrwxr-x   2 chris chris    4096 Sep  5 22:09 .
1968 drwx------  11 chris wheel 2011136 Sep  5 22:09 ..
$ ls -lAs
total 0

Sponsored Links
    #7  
Old Unix and Linux 09-06-2007
Raynon Raynon is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 18 April 2011, 3:56 AM EDT
Location: Sg
Posts: 353
Thanks: 0
Thanked 2 Times in 2 Posts
So does it mean that "total 0" means no alias ?

$ ls -lAs
total 0
$
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Locating a hidden file MaRiOsGR UNIX for Dummies Questions & Answers 1 05-22-2012 03:37 PM
Finding Hidden files and protecting the folder containing hidden files from deletion pochaw Shell Programming and Scripting 4 12-22-2007 12:33 AM
How to make a file Hidden gandhevinod Filesystems, Disks and Memory 1 02-15-2005 01:24 PM
Make a Hidden File gandhevinod UNIX Desktop for Dummies Questions & Answers 1 02-15-2005 11:59 AM
File and Directory Names become hidden dbinsol1 UNIX for Advanced & Expert Users 10 05-29-2002 09:58 AM



All times are GMT -4. The time now is 11:57 AM.