mkdir command will create a directory inside your current location.
mv command will move a file or directory from its current location and place it elsewhere. The syntax is,
mv current_location new_location. It can also be used to rename files.
If the new location is a file, the file is renamed:
mv oldfile newfile
or if the target is a directory, the file is moved:
mv oldfile newdirectory/
Delete files with the 'remove' command,
or for a directory
rmdir, the directory has to be empty:
You can use
rm to remove directories with the
-r option, it removes files in a directory recursively. Be careful when using
rm, once you hit enter, the files are gone. After adding or removing files and directories, you can check and make sure it worked using the
less shows a small portion of the file,
more shows a larger portion (according to the manual, it will display your file 'one screen's worth of lines at a time').
head displays the first ten lines, and
tail displays the last ten lines. Both
tail have several useful options like how many lines to display.
less filename.txt #look through file with less tail -n35 filename.txt #print last 35 lines of file
grep function searches for a particular pattern of characters. The syntax for the grep function is:
grep pattern file-to-look-in.
grep will by default print the whole line in which it found the pattern. There are options to have it print only the match, line numbers, or just a count of how many times the pattern was found.
grep "scaffold" genome.fasta #prints all lines with "scaffold" in them grep ">" genome.fasta -c #counts the number of ">" characters in the file