store output of system command into a variable in r February 25, 2023 by Tarik Use intern=TRUE: a <- system("ls ", intern = TRUE)