create a server on port 790. This should be a listening port in continuous mode which runs something which tell you how many files can be found in /root. When you are counting you should ignore hidden files. Here is I have done
- I have created file at /root/script1 file which consists of the counts of the files in root
#!/bin/bash ls | wc -l > /root/counts
creating the server
netcat -l 127.0.0.1 -p 790 -e 'cat /root/script1' --continuous
connecting with the server
netcat 127.0.0.1 790
How do I call scr.sh file while connecting with the server so that after every successful connection the script1 file updated which holds the count of the files at /root directory?