Commands
Version 1.2 by Julien Fleury on 2021/01/07 00:32
Contents
Useful Linux commands
Here is a list of useful commands to be executed on a Linux server (debian). Feel free to contribute by feeding this page with your own tricks and tips.
Telnet like
It is often required to test if a host[:port] is reachable and access is granted from a server. Best way to execute a telnet like command on a Linux console is to work with special files used to communcate with peripherals. Thus, in order to test tcp port 8000 on server 10.100.100.100, simply try to write in file /dev/tcp/10.100.100.100/8000 and add a return value depending on success or failure
echo > /dev/tcp/10.100.100.100/8000 && echo 'up' || echo 'down'
-bash: connect: Connection refused
-bash: /dev/tcp/10.100.100.100/8000: Connection refused
down
-bash: connect: Connection refused
-bash: /dev/tcp/10.100.100.100/8000: Connection refused
down
No comments for this page