# Common Linux Commands

## `cd`

Moves the user into the specified directory. **C**hange **D**irectory.

`cd ..` to move one directory up

`cd` by itself to move to home directory

`cd -` to move to previous directory

`cd <directory-path>` to move to a directory (can be an absolute path or relative path)

## `cp <old_filepath> <new directory path>`

Copies the file into the specified directory

## `clear`

Clears the terminal

## `cat <filename>`

Lists the contents of a file. Concatenate files.

## `ls`

List contents within the current directory

## `grep <string_to_match> <filename>`

Searches for the string / [regular expression](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) within the specified file and prints the line(s) with the result

## `pwd`

Displays the path of the current directory that you are in. **P**resent **W**orking **D**irectory

## `man <command>`

Displays the help manual instruction for the given command

## `mv <file_name> <new_directory>`

Moves a file into a new directory.

`mv <old_file_name> <new_file_name>` to rename a file

## `mkdir <directory_name>`

Creates a new directory

## `rm <file_name>`

Deletes a file

## `rm -r <directory_name>`

Deletes directories and the contents within them. `-r` stands for recursive

## `rmdir <directory_name>`

Removes the specified directory (must be empty)

## `touch`

Creates a blank new file
