diff --git a/index.qmd b/index.qmd index 471d7e2..d706ed8 100644 --- a/index.qmd +++ b/index.qmd @@ -135,6 +135,8 @@ Source: [High Performance Python](https://learning.oreilly.com/library/view/high * If data doesn't fit in memory make sure it's on fast storage (local) ::: +{{< include slides/linux_commands.qmd >}} + ## Introduction to High Performance Computing (HPC) {.smaller} * Lots of meanings * Often just a system with many machines (nodes) linked together with some/all of: diff --git a/slides/extra_slide.qmd b/slides/extra_slide.qmd deleted file mode 100644 index 1d699ad..0000000 --- a/slides/extra_slide.qmd +++ /dev/null @@ -1,3 +0,0 @@ -## A slide imported from outside the qmd - -This will become an example about how to use a common slide deck for the group. \ No newline at end of file diff --git a/slides/linux_commands.qmd b/slides/linux_commands.qmd new file mode 100644 index 0000000..c2ce284 --- /dev/null +++ b/slides/linux_commands.qmd @@ -0,0 +1,79 @@ +## `cd`: Navigate Directories {.smaller} +- `cd [directory]` -- Changes the current working directory to the specified directory. +- `cd ..` -- Move up one directory level. +- `cd /path/to/directory` -- Go to a specific path. +- `cd ~` or `cd` -- Go to the home directory. +- `cd /` -- Go to the root directory. + +## `ls`: List Directory Contents {.smaller} +- `ls` -- Lists files and directories in the current working directory. +- `ls -l` -- Displays detailed information about each file (permissions, owner, size, etc.). +- `ls -a` -- Shows all files, including hidden files (files starting with a dot). +- `ls -h` -- Displays sizes in human-readable format (e.g., KB, MB). +- `ls -lah` -- Combines the above options. + + +## `mkdir`: Make Directory {.smaller} +- `mkdir [directory_name]` -- Creates a new directory with the specified name. +- `mkdir -p /path/to/dir` to create nested directories. + + +## `rmdir` and `rm`: Remove Directories and Files {.smaller} +- `rm [file] `-- Removes a file. +- `rmdir [directory]` -- Removes an empty directory. +- `rm -r [directory]` - Removes a directory and its contents recursively. +- `rm -f [file]` - Removes to force remove a file (no undo be careful!). + + +## `mv` and `cp`: Move, Rename and Copy {.smaller} +- `cp [source] [destination]` -- Copies a file or directory to the destination. +- `mv [source] [destination]` -- Moves a file or directory to the destination. +- `mv` can also be used to rename a file or directory if the source and destination directories match. + +```{.bash} +cp file.txt /new/location/ +mv file.txt /new/location/ +mv old_name.txt new_name.txt +``` + +## Input and Output {.smaller} +- `echo [text]` -- Displays text or outputs text to a file. +- `echo $ENV_VAR` -- Displays the value of an environment variable. +- `touch [filename]` -- Creates an empty file or updates the timestamp of an existing file. +- `>` -- Redirects output to a file. +- `>>` -- Appends output to a file. + +```{.bash} +echo "Hello, Linux!" +touch file.txt +echo "Hello, Linux!" > file.txt +echo $HOME >> file.txt +``` + +## `watch`: Monitor Command Output {.smaller} +- `watch [command]` -- Repeatedly runs a command at intervals and displays the result. +- Use `watch -n [seconds] [command]` to change the interval. + +```{.bash} +watch -n 0.5 nvidia-smi +``` + +## man and help: Get Help {.smaller} +- `man [command]` -- Opens the manual page for a command. +- `help [command]` -- Provides a short description of built-in commands. + +```{.bash} +man ls +help cd +``` + +## `|`: Pipes!{.smaller} +Description: + +- `|` -- Pipes the output of one command as input to another. +- Useful for chaining commands together to perform complex operations. + +```{.bash} +ls | grep ".txt" +cat large_log_file.log | grep "ERROR" | less +```