A colleague is going on holiday and asks: "Put the drafts into archive." The ~/file-lab directory holds two drafts, draft1.txt and draft2.txt.
Put the drafts into archive
In ~/file-lab, run the four commands below in order: two moves, a directory listing, and a read of archive.
First, predict
What will ~/file-lab contain after the two mv commands?
Now start the exercise, run the command and compare your prediction with the output.
Where did the first draft go?
-
mvcannot join files: archive holds a single line,draft 2: server list. -
archive is not a directory: its line in
ls -lstarts with-, a directory showsd. You cannot put a file inside a file. -
The command line has no trash:
mvchanges a file's name or location at once.ls -a ~shows no trash folder.
The first mv renamed the draft to archive, and the second replaced that file with the second draft.