Mac users have this magic convenience of typing open index.html
into their terminal to open a file from their current directory in the browser. Those of us on WSL aren't so lucky. If you're lucky, the open
command will open a windows directory. Cool, I guess? But not exactly super helpful. The internet abounds with recommendations --- from trying xdg-open
, configuring your www-browser
defaults, and setting your PATH
environments to some even more convoluted methods. But the question remains: what's the easiest way to open an HTML file in the browser from WSL?
How to create and open an HTML file in TextEdit (Mac). And I wanted to throw up a simple HTML form when I found that the HTML file I was creating in the Native Mac text editor was not allowing.
The closest thing I've found is to use the Windows Subsystem for Linux's explorer.exe
command. Assuming you've set your browser environment variable in bash, then typing something lile explorer.exe index.html
should open the file index.html
in your default browser. If that works, congrags! That's the simplest version of Mac's open
command. Well, sort of...
- Click the button on the toolbar. Select the local file in the Open dialog. Click the Open button in the Open dialog to add the file. Click button to start. If the task is completed, you can right click the task item, and then click 'Open File' to open the image in your default image viewer.
- When the Open dialog box appears, type the text you want to search for in the Search box at the top right and press enter. A list of matching documents will appear for you to choose from. On the Mac, selecting the File menu and then Open (or just pressing Command + O) gets you to the File Open dialog box. Note: On Office 2016 for Mac you may.
Typing explorer.exe
is still a little bit of a handful, and I'm lazy. I mean open
is four characters, and explorer.exe
is twelve. That's three times as many characters. No thanks!
Wouldn't it be nice if we could do something simpler? How about see index.html
? Fortunately, we can leverage the ability to create aliases in bash to make this dream a reality. Just drop the following three lines directly into your terminal:
You're done! No need to play around in your config files. 🙌 Next time you need to open that index.html
file, all you need to do is type see index.html
and watch the magic happen. And it's one fewer character than those Mac folks. Just imagine what you could do with that kind of time savings...
This post shows you how to change your Filezilla settings so any file you view/edit in Filezilla, opens with a specific application.
In this case, all files will open using Text Wrangler for Mac users.
Windows users might want to set Notepad++ instead.
If you don’t configure these settings In Filezilla, your files may open using notepad in Windows or text/edit in Mac which isn’t safe to edit.
Rather then open your files using text/edit, notepad or your browser, a better and safer option is to open your files using your code editor.
If you view/edit a file in Filezilla after connecting to your server, it won’t automatically open using your default text/code editor:
To change the settings so the files on your server open with a specific program:
- Open Filezilla
- Tap the Filezilla tab
- Click Settings
Next, in Filetype associations ( Under File Editing ), uncheck inherit systems filetype associations because this feature does not always work.
Finally,
- Click file editing
- Use custom editor
- Browse for your code/text editor on your local machine
- Always use default editor
- Ok
If you haven’t setup your filetype associations correctly on your local machine, this should guarantee all file types open using your selected application when you edit/view the file in Filezilla.
Open Html File In Mac Os
Resources:
Open Html File On Microsoft Edge
- WordPress.org: Using Filezilla