LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what does "c" mean for "ls -l" command output? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-c-mean-for-ls-l-command-output-685614/)

newtovanilla 11-23-2008 05:07 PM

what does "c" mean for "ls -l" command output?
 
When I enter in the "ls -l" command, sometimes I see a "c" in front of an option. What does this "c" mean? I know that a "d" means a directory, but what does a "c" stand for?

billymayday 11-23-2008 05:12 PM

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

newtovanilla 11-23-2008 05:15 PM

so it is character unbuffered device file
 
Quote:

c= character (unbuffered) device file special
Thanks, so it is a character unbuffered device file.

What are those used for, and if I delete it is it going to mess things up?

billymayday 11-23-2008 05:21 PM

What's the file? I'd guess it'e in /dev or somewhere. Why do you want to delete it?

dxqcanada 11-23-2008 05:25 PM

Some character devices are created by certain hardware on your computer.
The Terminal sessions you open utilize character devices ... you sound card, pseudo TTY's used for Telnet ... etc.

Some devices in /dev are automatically created by udev, so they will appear again at bootup. Some devices are left over from legacy hardware.

You will really have to know what nodes are really required and which are not ... though this is not an easy thing to figure out.

newtovanilla 11-23-2008 05:30 PM

Quote:

Why do you want to delete it?
If it something that I don't need, then it would not matter if I delete it? I was cleaning up some files that are old or not needed.

billymayday 11-23-2008 05:47 PM

No it wouldn't. But given the space it occupies, and the risk of getting it wrong (ie actually needing it), why would you?

pixellany 11-23-2008 06:00 PM

If you are in system folders, I would be a bit careful about "cleaning up". Keep in mind that in Unix/Linux and similar systems: "Everything is file". But some of those "files" are really not files the way you might be used to seeing them.

If you don't know what something does, don't delete it.

kevinalm 11-24-2008 12:57 AM

Quote:

Originally Posted by newtovanilla (Post 3352183)
If it something that I don't need, then it would not matter if I delete it? I was cleaning up some files that are old or not needed.

If you have to ask what a block or charater device file is, you shouldn't be in /dev.
Sorry if that sounds harsh, but those files allow direct access to almost all your hardware. You can really screw up badly in there. You could... oh for example... wipe a hd partion by writing to the wrong file. The files themselves take up very little space, iirc less than a dozen or two dozen bytes each, don't recall precisely. And if you system is using udev then you need them _all_, because when you boot up only the ones you need are created each time you boot.

salter 11-24-2008 11:40 AM

Avoid cleanups in areas outside of the /home, /usr/local, and /media directories. All other places hold files necessary for something or required by something - it's easier to let them alone, then to restore your system after an unlucky cleanup situation.

i92guboj 11-24-2008 12:12 PM

Quote:

Originally Posted by dxqcanada (Post 3352176)
Some character devices are created by certain hardware on your computer.
The Terminal sessions you open utilize character devices ... you sound card, pseudo TTY's used for Telnet ... etc.

Strictly speaking, the hardware doesn't create anything. Some nodes are static (you can create as many as you wish by hand), but most of them are created by udev. Yes, they are created when you plug hardware, but it's not the hardware which creates them, but udev.

In the past a number of systems have been used to manage this, however with the deprecation of devfs most distros nowadays use udev to automate all this stuff.



Quote:

Originally Posted by kevinalm (Post 3352453)
If you have to ask what a block or charater device file is, you shouldn't be in /dev.
Sorry if that sounds harsh, but those files allow direct access to almost all your hardware. You can really screw up badly in there. You could... oh for example... wipe a hd partion by writing to the wrong file. The files themselves take up very little space, iirc less than a dozen or two dozen bytes each, don't recall precisely. And if you system is using udev then you need them _all_, because when you boot up only the ones you need are created each time you boot.

Ditto. A person that has to ask what a character device node is obviously is not prepared to say if a given node is needed or not. It's not harsh, it's just obvious.

Deleting a device node can render your system unusable, and will require a reinstall unless you know exactly what you are doing (and it that case you wouldn't have harmed your system in first place). But there are worse things that can happen if you write into a device node (i.e. like losing all your data, irreversibly). On defective hardware even worse things could happen, though that would be getting a bit paranoid.

geek_man 11-24-2008 12:39 PM

The c means that the entry is a character special file. Try to answer your questions by first looking at the man pages.

billymayday 11-24-2008 01:55 PM

Quote:

Originally Posted by geek_man (Post 3352976)
The c means that the entry is a character special file. Try to answer your questions by first looking at the man pages.

I'd be interested to know which man page to look at though. Any suggestions?

i92guboj 11-24-2008 02:10 PM

Code:

info ls
The man pages for coreutils seems not to get much love nowadays. The info page has the info you are looking for, on the place where it talks about the -l option. Right now I can't be more concrete.

geek_man 11-24-2008 07:37 PM

Quote:

I'd be interested to know which man page to look at though. Any suggestions?
In Solaris 10 when you type man ls you can find what the c means.


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