This content has been marked as final. Show 4 replies
user8053012 wrote:Yes it does display the information correctly.
gives the following result.
[a@dtest1 test]$ ls -lh
drwxr-xr-x 5 a app 4.0K Apr 3 14:13 buildlib
-rw-r--r-- 1 a app 80K Apr 1 11:38 cacerts
-rw-r--r-- 1 a app 76K Apr 1 14:30 cacerts_ab
How many are created and how many mb in size.
The following does not correctly.
You are being told that for the user you currently happen to be when you ran that command, there is one directory and two files. The total of 980K represents what your current user has permissions to see plus other non-visible items (which could be hidden files and/or hidden directories of files).
I suggest you go read the man pages for ls to get guidance on more command switches available and you might also try the same commands after you change to root user. Then compare the different outputs.
If you want to know just the file system block usage for directories and files you can use the du command. For more advanced functions, the find command is useful.
The command "du -s ./*" will show you a summary of files and directories in the current directory hierarchy. You can use "du -a" to see each file or even show the 10 largest files using "du -a /var | sort -n -r | head -n 10", for instance.
The "du" command does not show you the date. However, depending on what you are trying to achieve, there are other commands that are useful. For example: To find files that are older than 1 month and are larger than 1 GB "find / -size +1G -mtime 30 -ls". Find is a very versatile tool that provides many search options and can apply custom commands to its output.