The terminal is a text interface for executing text-based programs. With the failure of Sets, it looks like the classic console windows won’t be getting. These windows don’t have tabs, a feature Linux and Mac terminal windows have had for a very long time. But it’s based on the old Windows Console, as seen in the Command Prompt. Windows 10’s WSL, which lets you run Bash and other Linux shells, is great.
![]() ![]() Like Console For Windows Install The WSLSide note: what's the difference between a command line and a terminal?Generally you'll find these two terms used interchangeably. You could stick with the default command prompt ( cmd), and many tools will work OK, but you’ll find everything easier if you have better parity with Unix tools. You can find all the documentation you need in the Windows Subsystem for Linux Documentation.In terms of what option to choose on Windows, we’d strongly recommend trying to install the WSL. But things are getting better.Windows has traditionally had its own terminal-like program called cmd (“the command prompt”) for a long time, but this definitely doesn’t have parity with Unix commands, and is equivalent to the old-style Windows DOS prompt.Better programs exist for providing a terminal experience on Windows, such as Powershell ( see here to find installers), and Gitbash (which comes as part of the git for Windows toolset)However, the best option for Windows in the modern day is the Windows Subsystem for Linux (WSL) — a compatibility layer for running Linux operating systems directly from inside Windows 10, allowing you to run a “true terminal” directly on Windows, without needing a virtual machine.This can be installed directly from the Windows store for free. WindowsAs with some other programming tools, using the terminal (or command line) on Windows has traditionally not been as simple or easy as on other operating systems.This usually becomes easier as you get more familiar with the structure of your file system, but if you are not sure of the path you can usually figure it out with a combination of the ls command (see below), and by clicking around in your Explorer/Finder window to see where a directory is, relative to where you currently are.For example, if you wanted to go to a directory called src, located inside a directory called project, located on the Desktop, you could type these three commands to get there from your home folder:There are a number of other basic utility commands that you’ll probably end up using quite a lot as you work with the terminal. Bear this in mind as you move forward.If the directory you want to go to is nested deep, you need to know the path to get to it. For example, after typing the above two commands, try typing cd D and pressing tab — it should autocomplete the directory name Desktop for you, provided it is present in the current directory. Do you have to use the terminal?Note: A very useful terminal shortcut is using the tab key to autocomplete names that you know are present, rather than having to type out the whole thing. The command line is the literal line where you enter commands and the cursor blinks. A shell is your session and session environment (where things like the prompt and shortcuts might be customised). Olin ross or880 manualFor example rmdir my-awesome-website will remove the directory we created above. rmdir — removes the named directory, but only if it’s empty. For example, mkdir my-awesome-website will make a new directory called my-awesome-website. mkdir — this creates a new directory inside the current directory you are in, with the name you provide after the command name. Technically the file is being moved, but from a practical perspective, this command is actually renaming the file. This command moves a file called mdn-example.md in the current directory to a file called mdn-example.txt in the current directory. mv — moves a file from the first specified file location to the second specified file location, for example mv mdn-example.md mdn-example.txt (the locations are written as file paths). For example, touch mdn-example.md creates a new empty file called mdn-example.md. touch — creates a new empty file, inside the current directory. Make sure there is nothing you might need inside the directory later on, as it will be gone forever. Note that this delete is permanent and can’t be undone via the recycle bin that you might have on your desktop user interface.We’ve alluded to this before, but to be clear — you need to be careful with the terminal. For example, rm mdn-example.txt deletes a single file called mdn-example.txt. rm — removes the specified file. For example, cp mdn-example.txt mdn-example.txt.bak creates a copy of mdn-example.txt called mdn-example.txt.bak (you can of course call it something else if you wish). Usb c for mac wattageThis is a community-driven documentation service, similar to MDN, but specific to terminal commands.In the next section let’s step it up a notch (or several notches in fact) and see how we can connect tools together on the command line to really see how the terminal can be advantageous over the regular desktop user interface. Along with being a great place to try out web development code, the projects also give you access to a terminal, so you can run all these commands directly in that terminal, safe in the knowledge that you won’t break your own machine.A great resource for getting a quick overview of specific terminal commands is tldr.sh. If you are not careful, then you might end up deleting something important, losing you a load of your work in the process.One good habit to get into is to write your terminal command out inside a text editor, figure out how you think it should look, and then make a backup copy of your directory and try running the command on that first, to test it.Another good tip — if you’re not comfortable trying terminal commands out on your own machine, a nice safe place to try them is over at Glitch.com. ![]() Fewer options tends to mean simpler.
0 Comments
Leave a Reply. |
AuthorKim ArchivesCategories |