Prework Flashcards
Command, regardless of where we currently are, will take us to our home folder
cd ~
Command to create a file
touch file.txt
Command to open a file
open joke.txt
Command to see whats in a file without opening it
cat file.txt
Command to create a folder
mkdir folder
command to move a file into a folder
mv joke.txt funny_things/
command for remove
rm
options to commands format
Options to commands are always of the format –word or
-letter
Command for copying folders
cp -r folder copy_of_folder
Command Line
A text-based interface.
Synonyms: command-line interface (CLI), console
Terminal
An OSX application that provides text-based access to the operating system;
Any device or application used for data entry and display in a computer system
Synonyms: client, computer terminal, terminal emulator
File System
A file system is a systematic way to control how information is stored and retrieved. It describes where one piece of information stops and where the next one begins. Each file system has its own structure and logic.
Synonyms: NTFS (Windows’ File System), HFS+ (Apple’s File System), file allocation table, GFS (Global File System)
Directory
An organizational unit, or container, used to organize computer files into a hierarchical structure.
Synonyms: folder, catalog, drawer
Path
A sequence of symbols and names that identifies a file or directory. The path always starts from your working directory or from the root directory, and each subdirectory is followed by a forward slash.
An absolute or full path begins with the root directory and specifies every directory above the terminating file or directory name.
A relative path does not include the root or parent directory names, and refers to a file or directory directly below the current working directory.
Synonyms: pathname
Command
The action we want the computer to take; always a single word.
Synonyms: utility
Option
Follows the “command” in a command line, to modify the behavior of the command in some way.
Synonyms: flag
Argument
Follows the “command” and “options” (if any) in a command line, and is used to explain what we want the command to act on.
The number of arguments used generally depends on the command: some don’t need arguments, some require exactly one argument, some require lots of arguments, and some are flexible in the number they can take.
Prints the working directory; returns the absolute path name of the current directory.
pwd -options
Lists directory contents.
ls [-options] [path/to/directory]
Changes the current working directory to the specificed directory.
cd [-options] [path/to/directory]
Makes a new directory
mkdir [-options] [path/to/directory]
Removes directories or files permanently
rm -r [path/to/file] [path/to/file] …
Moves directories or files to a new local
mv [-options] [path/to/file] [path/to/directory]
Renames a file or directory.
mv [-options] [path/to/file] [NEW_FILE_NAME]
version control
making a saving multiple versions of a project so you can restore an old version
command to list files including hidden files
ls -a
git init
hides a .git file in the directory you are working in so it can use the git stuff. turns directory into a git repository or “repo”
update on the status of a git project
git status
git
An open source program for tracking changes in text files. It was written by the author of the Linux operating system, and is the core technology that GitHub, the social and user interface, is built on top of.
Commit
An individual change to a file (or set of files).
It’s like when you save a file, except with Git, every time you save it creates a unique ID (a.k.a. the “SHA” or “hash”) that allows you to keep record of what changes were made when and by who.
Commits usually contain a commit message which is a brief description of what changes were made.
Synonyms: a revision
Diff
A diff is the difference in changes between two commits, or saved changes.
The diff will visually describe what was added or removed from a file since its last commit.
Remote
The version of something that is hosted on a server, most likely GitHub.com. It can be connected to local clones so that changes can be synced.
Repository
The most basic element of Git.
A repository is a project’s folder, containing all of the project files (including documentation), and stores each file’s revision history. Repositories can have multiple collaborators and can be either public or private.
Fork
A personal copy of another user’s repository that lives on your account.
Forks allow you to freely make changes to a project without affecting the original.
Forks remain attached to the original, allowing you to submit a pull request to the original’s author to update with your changes.
Clone
A copy of a repository that lives on your computer instead of on a website’s server somewhere, or the act of making that copy.
With your clone you can edit the files in your preferred editor and use Git to keep track of your changes without having to be online.
It is, however, connected to the remote version so that changes can be synced between the two.
You can push your local changes to the remote to keep them synced when you’re online.
Push
Pushing refers to sending your committed changes to a remote repository such as GitHub.com.
For instance, if you change something locally, you’d want to then push those changes so that others may access them.