Is it possible to email a file from another directory in Unix shell prompt? In other words, do we have to be in the directory where the file is located to mail the file?
I was in the Mail directory and my file (filename) is in the Practice directory. I tried this and it didn't work:
mail -s "test email" email@hotmail.com < ..practice/mail/filename
The file is in Mail, which is in Practice, which is in Unix directory.
mail -s "testing" email@hotmail.com < practice/filename
(This assumes that your "ls" is fairly normal and has not been aliased. I only mentioned that because a normal unix "ls" does not put a solidus after the directory name - that would need "ls -p").