Arizona Cardinals 2020 Preview

Drafting 2018 Heisman Trophy winner QB Kyler Murray with the first overall pick a year ago, the Arizona Cardinals showcased a drastically improved team in 2019 on their way to a 5–10–1 record. With…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Terminal Topics

I imagine the first time we all looked at our instructor open the terminal and use the command line, we felt something like this…

When we began Flatiron’s Software Engineering program, many of us had never used or possibly even seen the terminal. The black box that has endless uses, commands and features. As we’ve dived deeper into HTML, JavaScript and now React, we have simultaneously gone further with our understanding of the terminal itself.

Through our progression of the course, I began to notice that almost all our instructors, teaching assistants and lecturers almost always have their terminal open. I then began to notice that almost all professional developers use their keyboard as much if not more than they use their mouse to interact with their computer.

There are a few terminal shortcuts and tricks that I’ve found have made the terminal easier to navigate. As we got into lectures that had code alongs, many of us ran into issues with the terminal, getting lost or confused as to where to run certain commands and how to run them.

First: pwd. This stands for “print current working directory.” This command will simply tell the user which directory, or file, they are currently in. For example…

As you can see, the “pwd” command is telling me what file I am currently in. This is the same as pointing and clicking into the desktop folder that are present on most desktops. This command will essentially give you a reference point as to where you are in the terminal itself.

Second: “ cd ..” cd, standing for “change directory” and the two “..” that follow, will move your current location that you are in, to the parent of that folder. For example…

Running “cd..” moves you back up to the folder that contains the folder you were previously in. To clear it up, I have all my phase 2 labs in the phase 2 folder which is inside the Flatiron folder. “cd..” will allow you drill down, similar to code, to files within files.

Third: “ls” is the command that will list all the files of the folder that you are currently in.

If you’re unsure as to where you are or where you need to enter a command, “ls” will provide a viewpoint for you, directing you either up or down the chain of files that you need to access. When in doubt, “ls”, and you’ll more than likely figure out whether you’re too high or too low in your file path.

Fourth: using the tab button to complete terminal commands.

Getting further into our programming journey, the amount of key strokes that we will strike will enter astronomical numbers. To minimize that, at least in the terminal, the tab button comes into play, and saves a lot of time. For files that are buried within numerous files, the command line to enter them can become exceedingly long. For example…

To type out these commands, you have to type it exactly as it’s written. Instead of entering each key stroke, if you enter the first few correctly and hit the “tab” button, the terminal will complete the rest for you. If you only type “cd phase-1-j”, and then hit tab continually, it will run through all the files that start with “phase-1-j”. Then you can stop on the file that you need to use and simply press enter.

Getting used to the terminal does take time. I’m sure we’ve all entered something into the command line that we did not intend, and editing lines in the command line isn’t like using Microsoft Word. If you’ve written out a command and made a few errors, simply press “control C”, and a fresh command line will appear under the line that you no longer intend to use. The line with the errors is rendered useless, but you can still see what you may need to type. For example, if you paste the wrong item in the terminal, pressing “control C” will give you a new line and a view of the previous one you used.

Last, but certainly not least, use the up arrows to run commands that you have previously entered in the current terminal session you’re in. The terminal holds all the commands that have been entered. This feature may be a small one, but it is another time saver, and will make your use of the terminal far more efficient.

Flatiron East Cohort-A, down the road…

Add a comment

Related posts:

Do Bitcoins consume more electricity than our country?

Bitcoin has been the buzz for quite a few days throughout the world. Its ever-increasing price is becoming the major point of interest. This triggered me to look into what a cryptocurrency is and how…