reading-notes

Class 02: Text Editors & the Terminal

Text Editors



Word processors: MSword, Google docs, Apple pages, Wordperfect, etc.

Code editors: GitHubs Atom, VS code, Visual Studio, NotePad++, Vim, Emacs, Nano, etc.


The Terminal- The Command Line Interface (CLI)

What exactly is a command line/terminal?

It’s a way to directly request information from your computer by simply entering simple text commands/requests. It then responds to your request with simple text information.


File Explorers

There are two types of file explorers; The standard ‘find files by point and click,’ or using a terminal. They each have similar tasks but using the Terminal can do so much more by using a command line.

File Explorer Tasks:

Terminal Tasks:



Relative path
: A file or directory location relative to where we currently are in the file system.

Absolute path
: A file or directory location in relation to the root of the file system.

Beginning Commands

Command Task
cd . To go back one directory
mkdir new-folder To create a new folder
cd new-folder, pwd, new-folder: touch myfile.md To create a new file in that folder
cd To go back to the home directory
clear clear your screen
cd p(plus the tab) To search files by letter names
tree command To get a branch diagram of all your folders
cntrl plus c To stop a command from running
code . To switch over to VScode

Changing to a new directory: cd (change directory), use “ cd projects” ,use with pwd, then ls to list

Using the up/down arrows- will cycle through your previous commands

To search files by letter names: cd p(plus the tab) - will show all the folders starting with p, add pr and get the projects.

To get a branch diagram of all your folders: tree command (only do this for a direct folder not the whole computer

To stop a command from running: cntrl button plus c

To chain together a path you need use fwd/: for example- cd projects/courses/102


OhMyZsh

OhMyZsh-Cheatsheet

Linux Tutorial-Terminal


Answer

What are four important features to look for in a text editor?

  1. Code completion
  2. Syntax highlighting
  3. Choice of visual themes to reduce eye strain
  4. Ability to choose from several extensions

What do the following commands do?

Can you explain what is happening in the following scenario if these commands and arguments are entered into the command line? (Arguments are extra instructions given to a command.)

  1. ‘cd projects’: this will show all the folders named projects.

  2. ‘mkdir new-project’: this will open/start a new project folder.

  3. ‘touch new-project/newfile.md’: this will make a new empty file under the new-project folder, named newfile.md (markdown file)

  4. ‘cd ..’ : this will take your back 2 directories from where you currently are.

  5. ‘ls projects/new-project’: this will pull a list of all the files related to the projects/new-project.