How do I open a file?


I’m on the command line basics part of web development. I need help opening test.txt. It says specify the TextEdit program if you must And then it says type Hello World! I’ve tried:
open test.txt but that didn’t work.


What OS are you using?


Windows 10


Are you using WSL?


I’m not sure what that is. I’m using Git Bash, and I already made a test.txt file.


open is a mac specific command. I am not sure if windows has an equivalent.


I have not looked at the curriculum, but in a nutshell, are you trying to open and edit or open and display the .txt contents? GitBash is similar to UNIX I believe and on my windows machine, ‘cat’ opens and displays the text file’s contents. To edit you’d need to use an editor command. You can look that up on GitHub ; I don’t recall atm what the command is.


I don’t know if this gonna work on win 10 or not
but in linux there is no command called open, but there is a command called xdg-open
try it and see if it works, if it works and you want something like mac open command
type this in your terminal alias open=“xdg-open”