Command Line, Git, and GitHub Basics Flashcards
a text-based environment where you can do things like create, move, copy, and delete files and folders, using different commands that are like mini-programs.
The command line
What is used to keep track of changes in files within a project. It allows you to take snapshots of a project at different points in time, create different versions of a project, and move between and even combine those different versions.
Version Control ystem
change directory, used to move from one directory (a.k.a., folder) to another
cd: cd ~ = home directory ; cd .. is a shortcut for the parent directory
print working directory, used to print the name of the folder you’re currently in
pwd
list, used to list the contents of a directory
ls
make directory, used to create a new directory
mkdir. For multiple files use: mkdir -p test/cats/dogs/bears
used to create a new (empty) file with a given name
touch
remove, used to remove a file (or folder)
rm
remove directory, used to remove a directory
rmdir
move, used to move a file or directory
mv
copy, used to copy a file or directory
cp
list all file including hidden
ls -a
(short for conCATenate) is used to print out the contents of a file to the command line.
cat command ex: cat file_folder/file.txt
To make a file or folder hidden, all you have to do is use a _______ as the first character in the name.
period (.) example: touch .hidden_file.txt
To hide a file on Windows, you must set the file’s _____ to hidden as well.
attribute : This can be done in Git Bash using the attrib command. Type attrib +h plus the file path in quotations. For example:
$ attrib +h “C:\Users\benvi\test.hidden-file.txt”