Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Getting Started with the Console Moving and Deleting Files

Explaining Console Vocab: Argument, Nested, Recursive, and Flag

From video: https://teamtreehouse.com/library/console-foundations/getting-started-with-the-console/moving-and-deleting-files

Jim never explained the vocab/concepts of an argument in the console, what a nested directory is, what recursive means, and what flag is. Can someone fill me in on these concepts? Thanks!

1 Answer

Angelica Hart Lindh
Angelica Hart Lindh
19,465 Points

Hi,

With regards to your question about the vocabulary for the command line the following may help:

Arguments

An argument is the information provided to a program when it is started and can have many of these. In the following example, 'rm' is the program and 'file.txt' is the argument

  • $ rm file.txt

Directory / Nested Directory

A directory is a file or folder cataloging system that references other files and folders. In the example below '~/Documents' is a directory (folder), and then the 'myFolder' directory is within 'Documents' and therefore nested

  • ~/Documents/myFolder

Recursive

This is a term that means to perform the operation of a program on each of the arguments passed to it. For example below we want to copy all of the files within the '~/Documents/' directory and move them to the '~/myNewFolder/' directory. To do this on the files nested within 'Documents' we need to perform the cp program on each of the files to do this we pass the ' -r ' flag.

~/Documents
   File1.txt
   File2.txt
   File3.txt

$ cp -r ~/Documents ~/myNewFolder

Flag

With regard to the command line a flag represents a boolean value. By including the flag you are setting the boolean value to true so the program. In the ^^above^^ example the ' -r ' is the flag that sets the 'recursion' of the program to true.

Hope that helps,

Cheers