# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccv.brown.edu/oscar/quick-reference/common-linux-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
