Seems like the geth.ipc file is not present in the path mentioned in your command.
If you have initialized the genesis block correctly then you should have the file in ./data directory. Anyways you can find it like this:
It will show the location and then use that location
geth attach ipc:/<path to file>/geth.ipc console