Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The 'l' in "lr-xr-xr-x" means that the file is actually a symbolic link, a pointer to another file. That's why it shows "/dev/ttyS0 -> tts/0", that's where it points to. See more on Linux file permissions at http://www.comptechdoc.org/os/linux/...ugfilesp.html.
/dev/ttyS0 is the first character device for serial terminal lines.
There was an extra point character '.' in the link. Here it is: http://www.comptechdoc.org/os/linux/..._ugfilesp.html
As for the two types of files, yes they exist in Linux too. I'll quote from one of the man pages, for a brief explanation:
Quote:
A special file is a triple (boolean, integer, integer)
stored in the filesystem. The boolean chooses between
character special file and block special file. The two
integers are the major and minor device number.
Thus, a special file takes almost no place on disk, and is
used only for communication with the operating system, not
for data storage. Often special files refer to hardware
devices (disk, tape, tty, printer) or to operating system
services (/dev/null, /dev/random).
Block special files usually are disk-like devices (where
data can be accessed given a block number, and e.g. it is
meaningful to have a block cache). All other devices are
character special files. (Long ago the distinction was a
different one: I/O to a character special file would be
unbuffered, to a block special file buffered.)
The Unix philosophy is: "everything is a file". That makes life easy, the same system calls are used to read from any device. Special device nodes are inodes that refer to a device rather than to a file. They come in two kinds: block special devices are block-structured, allow random access, and, in case they contain a filesystem, can be mounted. The typical example is a disk. All (other) devices are character special devices. One has tapes, scanners, modems, etc. Also block special devices can be often accessed via a character special device node.
Device special files are very simple: the inode contains a pair of small integers (the major and minor device numbers), and these numbers are used by the system as index in some table to find the driver for the device.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.