Dir Ownership?

If none of the more specific forums is the right place to ask

Dir Ownership?

Postby Carlosinfl » 2005-10-22 15:39

I was looking at my directories in my user dir /home/carlos & noticed that 2 directories have "root" next to it but I don't know why? I think I may have made those directories as root.

Code: Select all
carlos@stricom:~$ ls -l
total 24
drwxr-xr-x  2 carlos carlos 4096 2005-10-14 18:49 drivers
drwxr-xr-x  3 carlos root 4096 2005-10-20 17:37 files
drwxr-xr-x  4 carlos root   4096 2005-10-19 11:38 movies
drwxr-xr-x  3 carlos root   4096 2005-10-19 10:38 music
drwxr-xr-x  7 carlos carlos 4096 2005-10-19 14:21 pics
drwxr-xr-x  5 carlos carlos 4096 2005-10-21 07:33 software


Can someone tell me why the above shows root and how I can change this? to read "carlos" like the rest? I tried "chown carlos /home/carlos/files" and that did not work.

Thanks for any help.
Carlosinfl
 
Posts: 889
Joined: 2005-02-05 06:11
Location: Orlando, FL

Postby Demetrius » 2005-10-22 16:43

The syntax for chown is chown owner:group. So to change both owner and group you'd use chown carlos:carlos files. To change only the owner you'd use the command you used. To change only the group you'd use chown :carlos files.
Demetrius
 
Posts: 49
Joined: 2005-09-15 17:20

Postby Carlosinfl » 2005-10-22 17:08

Thanks...Just out of curiosity, what is the 4096 between the group and date created?

Code: Select all
stricom:~# chown carlos:carlos /home/carlos/*
stricom:~# cd /home/carlos/
stricom:/home/carlos# ls -l
total 24
drwxr-xr-x  2 carlos carlos 4096 2005-10-14 18:49 drivers
drwxr-xr-x  3 carlos carlos 4096 2005-10-20 17:37 files
drwxr-xr-x  4 carlos carlos 4096 2005-10-19 11:38 movies
drwxr-xr-x  3 carlos carlos 4096 2005-10-19 10:38 music
drwxr-xr-x  7 carlos carlos 4096 2005-10-19 14:21 pics
drwxr-xr-x  5 carlos carlos 4096 2005-10-21 07:33 software
stricom:/home/carlos#
Carlosinfl
 
Posts: 889
Joined: 2005-02-05 06:11
Location: Orlando, FL

Postby Demetrius » 2005-10-22 18:02

The size, in bytes. If you want a more easily readable output for that number, use ls -lh.
Demetrius
 
Posts: 49
Joined: 2005-09-15 17:20

Postby Carlosinfl » 2005-10-22 18:06

That makes no sense to me if that ls -l shows size in only bytes.

Some of those dir's are empty and some have GB's of data in them. How can they all show 4096 bytes? I will check the ls -lh command.
Carlosinfl
 
Posts: 889
Joined: 2005-02-05 06:11
Location: Orlando, FL

Postby Demetrius » 2005-10-22 18:11

Everything in unix is treated as a file. The listing from ls will tell you how much space the directory file takes up, not its contents. A folder will fill a block of space on your hard drive (every file, regardless of how small, will fill at least one block). If your folders show a size of 4096 bytes, or 4kb, that would indicate that your hard drive is formatted with blocks that are 4kb in size.

If you want to see how much space the contents of a folder take up you need to use the du command. See its manpage for details.
Demetrius
 
Posts: 49
Joined: 2005-09-15 17:20

Postby Jeroen » 2005-10-24 18:55

Particularly, the directory is a sort of 'file' in which there is a list of file names and a number (inode) pointing to the file (or directory, or ...) to which it corresponds: it is an index of what's contained in that directory, it is not the full directory itself.
Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
 
Posts: 571
Joined: 2004-04-06 18:19
Location: Utrecht, NL


Return to General Questions

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable