I am a beginner with Kali Linux and am learning with a textbook. I have written the following shell script:
Code:
#! /bin/bash
# This script is designed to find hosts with Postgres installed
nmap -sT my_IP_address -p 5432 >/dev/null -oG MyPostgresScan
cat MyPostgresScan | grep open > MyPostgresScan2
cat MyPostgresScan2
I try to understand what >/dev/null does. I assumed that the standard nmap output is sent to /dev/null and from what I have learned, this is a place in Linux where output disappears.
When I run my shell script I can see that there are two files written to my pwd: MyPostgresScan and MyPostgresScan2. I expected MyPostgresScan not to be in my pwd. The second file is expected to be there.
Can someone explain me why the file MyPostgresScan is written to my pwd?