LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Directory listing - what do the attribute fields refer to? (https://www.linuxquestions.org/questions/linux-newbie-8/directory-listing-what-do-the-attribute-fields-refer-to-4175519954/)

Arbutus99 09-24-2014 02:19 PM

Directory listing - what do the attribute fields refer to?
 
Using ls -l on /dev I see that some devices (files) have a different attribute pattern than most other directories and files.

I have several video devices installed, /dev/video0 for example.

ls -l shows:

crw-rw---T+ 1 root root video .... video0 etc

other devices show:

brw-rw---T 1 root root disk .... loop1

What do the b, c, T and T+ attributes mean?

Is there a simple way to test for the existence of a specific device or CLASS of devices? In my case I use a bash script to wake up a camera for a period of time and ftp the images in a long loop, but it would be more elegant to test if the camera is actually plugged in, before trying enter the working loop.

Debian 2014.09.09 on Raspberry Pi

Habitual 09-24-2014 02:27 PM

Type field: The first character in the field indicates a file type of one of the following:

Code:

    d = directory
    l = symbolic link
    s = socket
    p = named pipe
    - = regular file
    c= character (unbuffered) device file special
    b=block (buffered) device file special

says http://www.comptechdoc.org/os/linux/..._ugfilesp.html

Arbutus99 09-24-2014 02:35 PM

Mystery solved !
 
Thank you!

And the link you included is en excellent reference. Much appreciated !

jpollard 09-24-2014 02:37 PM

The + is that the file has an ACL attached.
If the file doesn't have an ACL attached it shows a ".".
When blank, the filesystem is either mounted with ACLs disabled, or doesn't support ACLs.

I don't see a "T+" on any of my device files.

suicidaleggroll 09-24-2014 02:54 PM

T means the sticky bit is set, but the execute bit is not:
http://askubuntu.com/questions/88391...ix-permissions


All times are GMT -5. The time now is 07:05 AM.