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.
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.
I am studying for the LPIC and I came across ls -F or file type and when it shows the indicator it mentions = as meaning socket and | as pipe. I know what a pipe is but does that mean there is such a thing as a pipe file?? Also what is a socket file or what does this mean if I am reading into it wrong? Probably a dumb question but it would be great if someone could fill me in. Thanks
Both are inter-process communication facilities. Sockets, also known as UNIX sockets, have the same programming interface and behaviour as network sockets, whereas named pipes, also known as FIFOs, behave like unnamed pipes.
The socket interface is described in the unix manual page (man 7 unix). Named pipes in man 7 fifo.
Some systems provide the pathnames /dev/stdin, /dev/stdout, and /dev/stderr. These are equivalent to /dev/fd/0, /dev/fd/1, and /dev/fd/2.
Unless I'm mistaken, this can be very similar
command1 | command2 | command3
command1 output to stdout, command2 takes command1's stdout as its stdin, processes it and sends the output to stdout, command3 takes command2's stdout as its stdin, processes it and sends it out to stdout, which is then interpreted by /dev/tty (the current terminal process) and displays it on screen.
The primary difference is that a socket is designed to provide a bidirectional data transfer without deadlocking... You can still deadlock, but the fault is then within the application.
A fifo/pipe will fill to its buffer, then block until something reads from it. It is a one way transfer.
You can also use a socket as if it were a pipe - but you cannot treat a pipe as a socket.
Thank you this helped. Here is a link that I found when researching your replys. It explains sockets and how unix uses file descripters for everything. I am posting it to help someone in the future. http://beej.us/guide/bgnet/output/ht...ge/theory.html
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.