How do I open a file?


#1

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.


#2

What OS are you using?


#3

Windows 10


#4

Are you using WSL?


#5

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


#6

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


#7

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.


#8

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”