1. How many lines, words and bytes does the 5j8v.pdb PDB file consists of? > teljes megoldás: wc 5j8v.pdb > csak a sorok száma: wc -l 5j8v.pdb > csak a szavak száma: wc -w 5j8v.pdb > csak a karakterek száma: wc -c 5j8v.pdb > és ezeket lehet kombinálni is, pl: sorok és szavak száma: wc -l -w 5j8v.pdb 2. What is the title of the PDB file? Print it on the console. (TITLE records) > azon sorok listázása, ami a "TITLE" stringgel kezdődik (a ^ karakter jelzi, hogy rögtön a sor kezdete után kell szerepelnie a "TITLE" string-nek): grep '^TITLE' 5j8v.pdb > ezekből a sorokból kitörlöm az elejéről a "TITLE" string-et (pontosabban lecserélem üres string-re): grep '^TITLE' 5j8v.pdb | sed 's/^TITLE //' > az így előállított sorok elejéről és végéről eltávolítom a space-eket és sorvége karaktereket: grep '^TITLE' 5j8v.pdb | sed 's/^TITLE //' | xargs 3. How many authors does the PDB file have? Print the line(s) to the console that start(s) with “AUTHOR”. > az előző feladat példájára kilistázom a szerzőket: grep '^AUTHOR' 5j8v.pdb | sed 's/^TITLE //' | xargs > minden nevet új sorba rakom (lecserélem a vesszőket új sor karakterre): grep '^AUTHOR' 5j8v.pdb | sed 's/^AUTHOR //' | xargs | tr ',' '\n' > megszámolom a sorok számát: grep '^AUTHOR' 5j8v.pdb | sed 's/^AUTHOR //' | xargs | tr ',' '\n' | wc -l 4. Lines starting with “REMARK  2” provide information about the highest resolution. Print those lines to the console, without the record name. A második feladat után ez már meg se kottyan... > Azon sorok listázása, ami "REMARK 2"-vel kezdődik: grep '^REMARK 2' 5j8v.pdb > És kitörlöm a "REMARK 245"-öt ezen sorok elejéről (a pont bármilyen karakter lehet): grep '^REMARK 2' 5j8v.pdb | sed 's/REMARK 2.. //' 5. How many CA atoms are there? (ATOM records, atom name is located in the 3rd column.) Na ez most trükkös lesz, mivel én úgy oldottam meg, hogy csak a harmadik oszlopban keressen "CA'-t. > Kiíratom a konzolra a fájl tartalmát (csak, hogy később tovább tudjak ezzel dolgozni): cat 5j8v.pdb > Eltávolítom az ismétlődő space-eket (az oszlopokat több space választja el): cat 5j8v.pdb | tr -s ' ' > Kiválasztom a harmadik oszlopot: cat 5j8v.pdb | tr -s ' ' | cut -f 3 -d ' ' > Kiválasztom azokat a sorokat, amelyekben a harmadik oszlopban "CA" van: cat 5j8v.pdb | tr -s ' ' | cut -f 3 -d ' ' | grep 'CA' > Megszámolom ezeket a sorokat: cat 5j8v.pdb | tr -s ' ' | cut -f 3 -d ' ' | grep 'CA' | wc -l 6. Print the atoms with serial number between 500 and 550 to the console. (ATOM records, the serial number is located in the 2nd column.) > Ez magáért beszél (najó, annyi, hogy $2 a második oszlopot választja ki, $0 pedig az egész sort): awk '{if ($2 > 500 && $2 < 550) print $0}' 5j8v.pdb 7. Print all the atoms to a file called 5j8v_atoms.pdb, but rename each C atom to CO. 8. Print the serial number of each atom, and their distance from the origin. Take care that the coordinates cannot be considered according to column number, because in certain lines there is no whitespace between the columns. Use instead the subsrt function, based on the character positions of the x, y and z coordinates in the ATOM records. (Example: subsrt($0,31,8) extracts 8 characters from the whole line starting from 31.)  For reference: http://www.wwpdb.org/documentation/file­format­content/format33/sect9.html#ATOM 9. In certain CONECT lines, the “CONECT” string is immediately followed by any number of digits. Print those lines again in a way that there is one whitespace character immediately after the CONECT string. 10. How many atoms belong to the chains A, B, C and D, respectively? (ATOM records; chain ID is in position 22.)