You'll see why this is important as you move farther in the course.Ĭongrats on running your first command in Terminal! □ That wasn't so scary, right? The rest of the commands we'll run in this course will be more action-oriented but equally safe. It's like Russian nesting dolls! My computer just told me exactly where I am within my computer's folders. Location - where you are in your computer - matters for almost everything you'll do in Terminal. It's the equivalent of a "You are here" sign so that you're never lost in your machine. My computer responds with /Users/emily.reese. Here's what my Terminal window looks like after running pwd: Output from the pwd command "Directory" in the world of computers just means "folder." By running this command, we're asking our computer which folder we're in. We'll see how to move around between folders in the next chapter. You can do this anytime, and it's very safe! Type it into your command line now: pwdĪnd press the Enter key. In order to see where you are at any time within your computer, you can type the command pwd. This means I need to be in my "Christmas party photos" folder within Terminal. For example, I could give instructions to Terminal to modify all image files in my "Christmas party photos" folder. Depending on where you are in your system, you'll be able to do different things with Terminal. They help you figure out your location and therefore what's just around you. That's why those red "You are here!" signs are so helpful. It's important to know where I am so I can plan my visit. For example, if I'm in Epcot, I can't ride the rides in Magic Kingdom. The things I can do depend on where I am in the park. You'll get the same empty line over and over! Since you're not giving the computer any actual instructions, it keeps showing you a new command line each time, waiting for your input. The prompt is the computer's way of saying "Hello, give me instructions!" □□ That's why, on the right-hand side, you have a cursor and space to type commands. The command line on your computer is a similar communication interface it's a portal in which you'll use your keyboard to type in a language the computer can read, and the computer will act out your instructions. You press "3," "0," and "Start" on a keypad in order to tell the microwave to heat something for 30 seconds. Imagine you're that you're using a microwave. This will vary per computer and per operating system! On the left-hand side of your command line within Terminal, you have what's called a prompt. You might see $, %, >, or other symbols, or you might see the name of your computer. The line is called the command line: First line when opening Terminal Let's visually break down what you see upon opening the Terminal. This is what it looks like on Mac: Command line appearance preferences Command line If you want to change the color of the text or your Terminal window to make it more snazzy, you can do so in the application's preferences. Imagine that your computer is just sitting there, waiting for instructions! Rest assured that nothing is currently happening. I see a simple dollar sign and a blinking cursor, but you might see the name of your computer too or other symbols: Terminal waiting for instructions My Terminal window looks like this, but yours is probably a different color or set of text on the left (which is fine!) When you first launch Terminal, you'll likely have an empty window with not much going on. This isn't the most efficient way to type this, but usually if I've lost a file, I do this iteratively, adding grep clauses as I go.To start this chapter, you should open Terminal or the equivalent application you're using. Starting in macOS Sierra (v10.12), you can press Command-Shift-Period in the Finder, and itll toggle visibility of normally-hidden files and folders. Choose Go menu > Go to Folder (Command-Shift-G), enter the path you want to go to (e.g. Locate is used much the same way, though grep is frequently more necessary: locate myfile | egrep home | egrep -v 'mozilla|cache|local|bin|\.pyc|test' | grep \.py You can use the Finder to navigate to hidden folders if you know their paths. To cut out the ones you don't like, e.g.: find | egrep askubuntu | grep txt | egrep -v iterationįind | egrep askubuntu | grep txt | egrep -v 'iteration|meta|other' (Run sudo updatedb if that hasn't been done recently.)Ī more realistic example of using find would be something like : $ find | egrep askubuntu | grep txt (If you don't know where it is, start where your shell drops you, in the top of your home directory.) You can use find in a directory above your file. (pastie, klipper, glippy, glipper, anamnesis) You would then triple-click or click-drag and copy, potentially saving this in your clipboard manager*, and paste it where you need. In addition to dragging the icon, there are a few ways to get the full path without nautilus (or thunar, konqueror, et al.).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |