reading-notes

My reading journal for Code Fellows.


Project maintained by mattlarkin8 Hosted on GitHub Pages — Theme by mattgraham

Terminal Practice

CLI and how to use it

The Command Line Interface is a text based interface that can be used to interact with your computer and file system in a similar way to using the normal GUI. You can navigate through different folders or directories by using cd, which stands for change directory. The ls command is short for list and will show you the contents of the directory you are currently in. To check which directory you are currently in you would use pwd (print working directory). Files can be created with the touch command. mkdir is short for make directory and creates a new directory. You can use the rm command to remove or delete both files and directories. You can copy files or directories using cp. The mv command is typically used to move a file or directory, but can also be used to rename files and directories. If you want to edit a file, you can use the vi editor, but there are some more commands you need to learn specific to vi if you want to be proficient in using it. Most commands have optional characters that can be added to a command to change its behavior or specify something more specific.

It is important to remember that with all of the commands that specify a file path, you have two different options to use. First is the Absolute Path, which specifies the location of a file in relation to the root directory and uses the full file path. This is good to use if you are using a command that targets a file that is not within your current directory. The Relative Path can be seen like a bit of a shortcut because it specifies the file location based on your current working directory. This means that you can use a shorter, easier file path instead of the full Absolute Path. You will probably use this most of the time since it is quicker and easier.

For help with the use of any command as well as its different options, you can look it up in the manual. The man command can be used with the command you want info on and it will give you the manual page for that command. This allows you to find the use of the command along with a list of its options and what they do.

Some helpful (and important) things to keep in mind are:

These will help you save time and hopefully avoid mistakes.