Introduction to Command Line - jacksonhturner/epp_531 GitHub Wiki
This document demonstrates how I upload a file to the sphinx.ag.utk.edu and execute a simple shell script.
Uploading files
Files can be uploaded to sphinx using the scp
command.
scp testfile1.fasta [email protected]:/pickett_sphinx/projects/EPP531_AGA/turner/
scp testfile2.fasta [email protected]:/pickett_sphinx/projects/EPP531_AGA/turner/
Writing and executing a simple shell script
Once the files are uploaded to sphinx, I then count and report the number of sequences in each file. I accomplish this through the use of a shell script, which I create with the nano
command.
nano count_seqs.sh
I will count the files using a for loop to report the file name of each file (with the echo
command) and then count the number of sequences with the grep
command with the -c
flag. I populate the shell script created by nano
with the following text:
for FILE in *.fasta; do echo $FILE; grep -c '>' $FILE; done
Once I populate this shell script and exit the text editor, I execute it with the following command.
sh count_seqs.sh
This command should report the following output.
testfile1.fasta
11
testfile2.fasta
4