I am using geth for running my blockchain node. I wrote my contract in the console itself and it got deployed and mined perfectly. I could invoke the functions of the contract in the terminal. I want to know in which directory on my computer would such a file be saved or where to create a .sol file to deploy contracts to my private blockchain ?
When you deploy a contract it's saved as EVM bytecode in blockchain. Unless you yourself separately save .sol and ABI .json files on your computer they are not stored.
It really doesn't matter in which directory you save the file. You can copy-paste the relevant source code into geth console.