Useful Terminal/PowerShell Commands¶
Depending on your operating system, open either terminal (Mac) or PowerShell (Windows). There are some similarities and some differences between Terminal and PowerShell commands. One important one is the usage of slashes (/) in case of Mac, and backslashes () in case of Windows, when specifying a path.
1. List files in the current working directory¶
2. Change directory¶
2.1 Relative path¶
the . before slash (/) means current directory .. means parent directory2.2 Absolute path¶
3. Create directory¶
You should now see a directory called "example" in your current working directory.4. Create a .txt file¶
Write something in the file (at least two lines).
5. Head and Tail¶
When working with large files, we encourage you examine them. Since files are often too big to be loaded into Excel, head and tail commands are good alternatives to get a good idea of what the file looks like (this only works for unzipped files, i.e. non-binary).
You can replace the word head with tail to see the end of the file.
6. Docker¶
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as operating system, libraries and other dependencies, and ship it all out as one package.
By running the following command, you create a docker container from an image that includes Ubuntu distribution and QIIME2.
After running this command, you should be in the container. This is indicated by the following text in your terminal (qiime2-2023.5). Once you list the files in the current working directory the files on your local computer should be reflected in the printed list.
We encourage you to check the help command and identify what each of the options mean (e.g. --rm, -it, -v, -w).
Files that you create while running qiime2 in the docker container will be reflected in your local directory after running the workflow commands.