Copying, Moving, and Deleting Files and Directories

Creating files and directories is only part of the story. In the GUI, you’ll drag files and directories to move them to new locations, and you’ll use the mouse to copy files from one place to another. And sometimes you’ll want to get rid of a file or an entire directory’s worth of files. You can do all of these from the CLI more quickly than you can with the GUI.

In the previous section, you created a directory structure that looks like this:

 files
 ├── code
 │   ├── elm
 │   ├── go
 │   └── js
 ├── docs
 │   ├── diagrams
 │   └── markdown
 ├── movies
 ├── music
 └── photos

Let’s create a few files in there. First, create some empty files in each subdirectory of the code directory. Use brace ...

Get Small, Sharp Software Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.