Use the following syntax to enter Bash commands.
! is used to execute a one-line command.
For example, use the following to list all files:
! ls -a
%%bash is a notebook magic used to execute multi-line commands. After this magic,
add a new blank line, and then one command per line after that.
For example, use this snippet to change the directory and list all files:
%%bash
cd data
ls -al
| Task | Command |
|---|---|
| Change Directory | cd <directory_name> |
| Make a New Directory | mkdir <directory_name> |
| Output Current Directory | pwd |
| List files | ls |
| List with hidden files | ls -a |
| List with details | ls -l |
| List with details and hidden files | ls -al |
| Copy a file | cp <source_file> <destination> |
| Move a file | mv <source_file> <destination> |