reading-notes

PREP: Practice in the Terminal

The Command Line

> The Command Line is a text based interface to the system where the user enters commands using the keyboard and will get a response based on that command.All terminals have shells but the most commonly used one is bash which stands for Bourne again shell. run echo $SHELL to see what your current shell is.

Basic Navigation

Navigation is an important part of using the command line. A lot of the things we do, such as cloning GitHub Repos or creating/delete files, depend on being able to point to the correct location of a file or director. Here are a few code commands commonly used.

More About Files

In Linux, EVERYTHING is a file. If we want to know what type of file something is, we just need to type file [path name]. For example, if I ran the file projects on my projects folder, the terminal will output projects: directory.

### Things to note

Manual Pages

Manual pages are a set of pages that document what a command is, it’s purpose, and its use. to look up a specific command you would type out 'man [comnmand to look up]' for example 'man ls'. Manual pages can also be searched using keywords 'man -k [search term]'.

File Manipulation

File manipulation covers all the things we can do in the file explorer but from the command line. these include Creating, deleting, renaming, and moving folders and files.

- mkdir <directory name> - Creates a directory
- rmdir <directory> - removes a directory
- cp <source> <destination> - copies a file (source) and creates a new file (destination)
- cp -r <source> <file> - Recursive copy that allows us to create copies of a directory.
- mv <source> <destination> - move items or directories into another directory. the `mv` command can also be used to rename files 
- rm <file name> - deletes a file
- rm -r <directory> - removes a non-empty directory.