LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2010, 10:26 AM   #1
cakuba
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Command "ls" display the directory size of ZERO


Hi, guys, I have learned Linux for a while now, but Linux is continuously surprising me with new stuffs nearly every day... Today I met a really strange problem, that the command "ls" indicates the size of some directories is ZERO, as for /home.

[root@localhost /]# ls -lh
drwxr-xr-x 2 root root 4.0K May 5 10:53 bin
drwxr-xr-x 4 root root 4.0K May 5 10:51 bio
drwxr-xr-x 4 root root 4.0K May 5 10:45 boot
drwxr-xr-x 4 root root 0 Jun 2 15:52 data
drwxr-xr-x 11 root root 4.0K May 20 21:36 dev
drwxr-xr-x 105 root root 12K Jun 2 15:52 etc
lrwxrwxrwx 1 root root 16 May 5 10:34 export -> state/partition1
drwxr-xr-x 3 root root 0 Jun 3 11:01 home


However, there is a directory inside /home, which contains many files/directories.

[root@localhost /]# ls -lh /home
total 4.0K
drwxr-xr-x 9 corona corona 4.0K Jun 3 11:03 corano

Even worst, when I tried to create a file under /home, I got the "permission denied" error,

[root@localhost home]# touch test
touch: cannot touch `test': Permission denied

By the way, /home is within the local file system, not NFS share. Can you guys provide any hint on this? Thanks
 
Old 06-03-2010, 10:43 AM   #2
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Rep: Reputation: 17
become the root user or use the "su" command and type this in

Code:
chmod 777 /home
this will allow you to write in the file.



If i helped you at all please click the "thanks" button at the bottom right hand corner

Last edited by edwardcode; 06-03-2010 at 10:45 AM.
 
Old 06-03-2010, 10:44 AM   #3
cakuba
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the suggestion. But it doesn't work,

[root@localhost /]# whoami
root
[root@localhost /]# ls -lsd home
0 drwxrwxrwx 3 root root 0 Jun 3 11:01 home
[root@localhost /]# touch /home/test
touch: cannot touch `/home/test': Permission denied

Last edited by cakuba; 06-03-2010 at 10:50 AM.
 
Old 06-03-2010, 10:48 AM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Try remounting the file system or rebooting.
 
Old 06-03-2010, 10:48 AM   #5
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Rep: Reputation: 17
did that work for you
 
Old 06-03-2010, 10:56 AM   #6
cakuba
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks, edwardcode, but it didn't work.
 
Old 06-03-2010, 10:57 AM   #7
cakuba
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rweaver View Post
Try remounting the file system or rebooting.
Would like to try, but cannot reboot right now. Any other suggestions? Thanks
 
Old 06-03-2010, 12:01 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Presuming the directories in question are mount points, what is the type of the file systems mounted there? df -T will display the types. And what is the output of the mount command (without any options or arguments)?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to make "ls" display the real size for directories louisJ Linux - Newbie 36 01-02-2012 01:00 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
How to issue "ls" command start with the largest file size in a folder? fjkum Linux - Newbie 5 07-27-2006 03:28 AM
The command "df -h" no show me the size of partition true! sandrobr Linux - Enterprise 7 01-03-2005 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration