Unix is an operating system, or collection of programs that allow a computer to operate. While most computer users only interact with a graphical user interface (GUI), bioinformatics utilizes files that are too large for GUI's to work with efficiently. Thus, most of bioinformatics is performed on the Command Line within the operating system, which users can input a command and the computer will execute and produce an output.
A tutorial created from UC Davis (UC Davis Command-Line Bootcamp) outlines many of the commands that allow a user to navigate around the computer and change directories (folders) and files characteristics, such as name, file type, and location that file is stored.
Some of the most essential commands are outlined below:
To figure out where in the computer you are: Print Working Directory (pwd) command
Input: UserName@computer: ~$ pwd
Output: /home/username
This output can be interpreted that I am in the home directory of UserName, which is usually where you can view Desktop, Documents, Pictures, Downloads, ect. through the use of commands listed below.
Once you know where you are, the next thing is to see what directories and files are present in the location found out by the pwd command.
This can accomplished using a simple list command called by the command ls
Input: UserName@computer: ~$ ls
Output: list of directories and files located where you are.
Another way of thinking of this is when you click on a folder in file explorer, the GUI will naturally list the other files and folders contained in that folder.
Instead of simply clicking on a folder to open it, a command must be inputted to move around your computer. This command is called change directory and inputted as cd.
Input: UserName@computer: ~$ cd
Output: you will be switched into that directory.
To ensure you've switched directories or to see what's present in the next directory, a simple ls command can be ran.
Bigger Picture and Useful Knowledge:
A tutorial created from UC Davis (UC Davis Command-Line Bootcamp) outlines many of the commands that allow a user to navigate around the computer and change directories (folders) and files characteristics, such as name, file type, and location that file is stored.
Some of the most essential commands are outlined below:
To figure out where in the computer you are: Print Working Directory (pwd) command
Input: UserName@computer: ~$ pwd
Output: /home/username
This output can be interpreted that I am in the home directory of UserName, which is usually where you can view Desktop, Documents, Pictures, Downloads, ect. through the use of commands listed below.
Once you know where you are, the next thing is to see what directories and files are present in the location found out by the pwd command.
This can accomplished using a simple list command called by the command ls
Input: UserName@computer: ~$ ls
Output: list of directories and files located where you are.
Another way of thinking of this is when you click on a folder in file explorer, the GUI will naturally list the other files and folders contained in that folder.
Instead of simply clicking on a folder to open it, a command must be inputted to move around your computer. This command is called change directory and inputted as cd.
Input: UserName@computer: ~$ cd
Output: you will be switched into that directory.
To ensure you've switched directories or to see what's present in the next directory, a simple ls command can be ran.
Bigger Picture and Useful Knowledge:
- Many commands that are inputted into a command line can contain options that can make the command more specific, such as listing files but sorted by date modified, or that will present more information such as file size and permissions of that file.
- One of the most useful options is the help option! Whenever learning a new command, it's helpful to read the help files associated with that command since it will show you what can be done. Help options can be invoked on most commands, such as ls, followed by --help or --h.
Input: UserName@computer: ~$ ls --help
Output: a list of options that can be used with a description of what they do.
- Manuals are also present within the command line, which provide more information than the help page, but can take longer to look through if only searching for a single option that you had forgotten.
Input: UserName@computer: ~$ man [command]
For example the list manual would called as:
Input: UserName@computer: ~$ man ls
Comments
Post a Comment