User Tools

Site Tools


It doesn't really exist – it's simulated by bash only when doing redirections. They're of the form:


To send stdout to a TCP connection:

$ mycomment > /dev/tcp/

To get a bidirectional TCP connection in shell script:

exec 3<>/dev/tcp/
echo -e "GET / HTTP/1.1\n\n">&3
cat <&3

To make an interactive bash shell appear for someone listening at port 9999:

bash 0<> /dev/tcp/ 1>&0 2>&0
there_s_a_dev_file_for_tcp_connections.txt · Last modified: 2010/09/02 15:12 by tkbletsc