Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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.
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.
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
Quote:
Originally Posted by newtovanilla
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.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.