class: center, middle # Linux is your friend --- ## cd = change directory / pwd = print working directory
Examples: - pwd:
/home/v.bezaras
- cd /home/v.bezaras/Projects - cd Projects - cd /home/v.bezaras/Downloads - cd . - cd ../Projects - pwd:
/home/v.bezaras/Projects
- cd /mnt/c/users/vbyazarene/Documents/ --- ## ls = list Examples: - ls - ls -l - ls -lh - ls -l /home/v.bezaras - ls -l .. --- ## less / zless - less file.txt - zless file.txt.gz - less -N file.txt - with line numbers - less -S file.txt - no line breaks #### Commands during view: - q - quit - /text - search - n - next occurence - N - previous occurence --- ## grep = global regular expression print / zgrep Examples: - grep "word" file.txt - lines containing word - grep -v "word" file.txt - lines not containing word - grep -i "WORD" file.txt - ignore case #### Pipe: | program1 | program2 | program3 Example: ls -lh | grep M | less --- ## xmllint Examples: - xmllint --format file.xml | less - zless file.zip | xmllint --format - | less #### Output redirection: > - command > file.txt - xmllint --format file.xml > formatted.xml - xmllint --format file.xml > /home/v.bezaras/Projects/xmlfile.xml --- ## XPath Examples: - xmllint --xpath "//Hotel" file.xml - xmllint --xpath "//Hotel[@Code='123']" file.xml Syntax: - / - search directly under current node - // - search anywhere under current node - [] - condition (can be read as "which") - @ - attribute - . - current node - text() - node value Examples: - //Hotel - find everywhere all hotel nodes - //Hotel[@Code='123'] - find everywhere all hotels which has attribute code equals 123 - (echo "<x>" && xmllint ... && echo "</x>") | xmllint --format - - xmllint --xpath "//ZUSCHLAEGE/ZUSCHLAG1/PREIS[text() < '10.00']" --- class: middle, center # End