unix_shell
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| unix_shell [2021/11/08 12:56] – 134.190.232.244 | unix_shell [2022/06/23 10:21] (current) – 134.190.232.106 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | upcoming | + | The commonly used scripts collected from previous Github page and course materials. |
| - | Here's a list of commands to retrieve deleted text in vi: | + | 1.How to set up timer for specific script run? |
| + | |||
| + | < | ||
| + | # | ||
| + | # Twosday.sh | ||
| + | |||
| + | while true; | ||
| + | do | ||
| + | DATE=`date | cut -d' ' -f4` | ||
| + | #echo $DATE | ||
| + | if [[ $DATE == " | ||
| + | then | ||
| + | echo "this is a test program" | ||
| + | qrsh | ||
| + | sleep 1s | ||
| + | fi | ||
| + | done | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # | ||
| + | # | ||
| + | while true; do echo -ne " | ||
| + | # | ||
| + | while true; do echo -ne "`date +%H: | ||
| + | </ | ||
| + | |||
| + | |||
| + | 2.Here's a list of commands to retrieve deleted text in vi: | ||
| < | < | ||
| Line 58: | Line 86: | ||
| # usage: ./ | # usage: ./ | ||
| + | # note:must leave extra line break for gene_id.txt | ||
| </ | </ | ||
| - | <Last updated by Xi Zhang on Oct 6th, | + | |
| + | < | ||
| + | #Remove duplicates in fasta file based on ID | ||
| + | |||
| + | https:// | ||
| + | |||
| + | awk '/ | ||
| + | |||
| + | https:// | ||
| + | |||
| + | awk '/ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | https:// | ||
| + | # To install python2 version | ||
| + | pip install pyfasta | ||
| + | # To install python3 version | ||
| + | pip3 install pyfasta | ||
| + | |||
| + | #split a fasta file into 6 new files of relatively even size: | ||
| + | pyfasta split -n 6 original.fasta | ||
| + | </ | ||
| + | |||
| + | Rename file name with the one user wanted https:// | ||
| + | https:// | ||
| + | < | ||
| + | |||
| + | for i in *; do -- mv " | ||
| + | for f in *; do mv " | ||
| + | |||
| + | for i in chr* | ||
| + | do | ||
| + | mv -- " | ||
| + | done | ||
| + | or | ||
| + | |||
| + | for i in chr* | ||
| + | do | ||
| + | NEWNAME=" | ||
| + | mv -- " | ||
| + | done | ||
| + | The " | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Usage: | ||
| + | rename [ -h|-m|-V ] [ -v ] [ -n ] [ -f ] [ -e|-E perlexpr]*|perlexpr | ||
| + | [ files ] | ||
| + | </ | ||
| + | |||
| + | |||
| + | How to use sort in linux, especially ignore the header to sort special col? | ||
| + | < | ||
| + | (head -n 1 all.txt && tail -n +2 all.txt| sort -n -r -k2) > 123.txt | ||
| + | |||
| + | # sort -n | ||
| + | #sort -r | ||
| + | #sort -k | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | <Last updated by Xi Zhang on Oct 6th,2021> <June 23th,2022> | ||
unix_shell.1636390611.txt.gz · Last modified: by 134.190.232.244
