In this session we will be looking at how we create content and how we remove content in UNIX. So let's start from the current directory. An ls will give us the directory content. And we have files for apple, for peach and for pear. We would like to have them organized by species. To do so, we will create a directory for each of the species and transfer the content corresponding to the species into those directories. Let's start by creating a directory for apple. We do so with a command called make directory, mkdir, and then the name of the directory, apple. We now have to populate the directory apple with its corresponding files, the genome, genes and samples file. We can do so by copying a file, or multiple files, from the current location to the apple directory. Let's start by copying, with the command cp, the file apple.genome into the apple directory. If we now list the content of the apple directory we will see apple.genome. There's still a copy of the apple.genome file in the current directory as well. ls apple.genome. So it's here. We can copy one file with a cp command, or we can copy multiple files. So we can copy apple.genes and apple.samples into the apple directory. And now if we list the content of the apple directory it will show all the three files. We could also have used the naming conventions and wild cards we showed in the previous section to copy all the apple-related files into the apple directory. And we can do so with cp, copy, apple.* into the directory apple. And the apple directory now reflects the three files. We can also move files, simply transfer the content, from the current directory to the target directory. For instance, we can move the pear.genome file into the pear directory. So if we now list the content of the pear directory. We have first to create the directory. So we can create directories for pear and we can create another directory for peach. And as you notice we can put both of them on the same command line. We can now move the pear.genome file into the pear directory. And listing the content of the pear directory will show pear.genome. We can move several files at one time. For instance, move pear.*, all the files in the current directory, into the directory pear. Now listing the content of the pear directory will show us that all the three files are represented there, pear.genes, pear.genome and pear.samples. Let's check to see, are there any more pear files into the current directory? Ls pear.*, and theres no such file of directory, so these files have been effectively transferred or moved into that particular directory. And we can apply the same to the peach files. And we shall move them into the peach directory. The peach directory then place peach.genes, peach.genome and peach.samples. And now let's check to see if any peach files have been left in the current directory. And there's none. So let's survey the content of the current directory. We still have the files apples.genes, apple.genome and apple.samples, which, you might recall, we simply copied into the apple directory. We want to remove these duplicates, and we can do so with the comment rm, remove file. So we can remove the file apple.genome. To verify, ls apple.genome. And indeed, it has been removed. In a similar way we can remove the other two apple files. However, we want to be very careful when removing files, because this operation is final. So one common line option for rm, -i, will allow us to change our minds. So if we type rm -i apple.genes, the prompt will ask us whether we indeed want to remove the file apple.genes. If we type y the file will be removed. If we type any other letter, the file will stay where it is. So let's type n, ls apple.genes, and the file is still there. Let's try now rm -i apple.genes. And we'll say y, yes, confirm. Now we can see that the apple.genes file has been removed indeed. And now we simply remove apple.samples in the same way. In addition to removing files, we might want to remove entire directories. For instance, our application mentioned two ancient species which are listed and have files in the directory Old.stuff. If we're looking at Old.stuff, it contains genome files for two species, agathis and araucaria. We want to remove these. So let's try the command rmdir, which is one command for removing empty directories. rmdir Old.stuff. And it cannot remove the directory since the directory is not empty. So we can first delete all the files and subdirectories, if applicable, from the directory Old.stuff. For instance, remove Old.stuff/agathis.genome and so on, and then try to remove our directory. That's one way of doing things. Another way is to just type rm -r, which stands for recursively, so remove recursively Old.stuff, which starts by removing all the subdirectories and their subdirectories and so on from the Old.stuff directory, and then removing the directory itself. So let's apply this. And let's look at the current content. So we have apple, peach, pear, and then the Old.stuff directory has been removed. Let's list the files again, now with all of your operations, and we can see we have now three directories, peach, pear and apple. And two files, months and orchard, which we'll be using in subsequent sections. This concludes our session on content creation and removal in UNIX.