3.17. Creating a Directory: mkdirRather than clog up my home directory with the many versions of "heart," I decided to create a subdirectory called "lyrics" in which to keep them all. To do this, I used the mkdir utility, as described in Figure 3-20.
Here's how I did it: $ mkdir lyrics ...create a directory called "lyrics". $ ls -lFG ...confirm. -rw-r--r-- 1 glass 106 Jan 30 23:28 heart.ver1 drwxr-xr-x 2 glass 512 Jan 30 19:49 lyrics/ $ _ The letter "d" at the start of the permission flags of "lyrics" indicates that it's a directory file. In general, you should keep related files in their own separate directory. If you name your directories sensibly, it'll make it easy to track down files weeks, or even years, after you create them. Once the "lyrics" directory was created, the next step was to move the "heart.ver1" into its new location. To do this, I used mv, and confirmed the operation using ls: $ mv heart.ver1 lyrics ...move into "lyrics" $ ls ...list the current directory. lyrics/ ..."heart.ver1" has gone. $ ls lyrics ...list the "lyrics" directory. heart.ver1 ..."heart.ver1" has moved. $ _ |