bash Commands

  • The general structure: <command> <flags + flag args> <command args>
    • command: What to do
    • flags + flag args: Options for the command and options for those options
    • command args: arguments to pass to the command

Listing files in the current directory

We want to list files in the specified directory. The bash command to list files is ls.

R

  • command: list.files()
  • flags + flag args: all.files = TRUE
  • command args: ".github"
list.files(".github", all.files = TRUE)
## [1] "."          ".."         ".gitignore" "workflows"

bash

  • command: ls
  • flags + flag args: -a
  • command args: .github
ls -a .github
## .
## ..
## .gitignore
## workflows

Long Commands

  • Long commands are split onto multiple lines with a trailing backslash
this is a \
  really really \
  long command