-
Notifications
You must be signed in to change notification settings - Fork 4
úkoly 1: Git, 2: Bash I, 3: Správa uživatelů #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ejegrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zkontrolovány zatím úkoly 3a a 3b 👍
podzim_2025/lucie-talasova/LT-ukoly3b-sprava_uzivatelu-prakticka_cast.md
Show resolved
Hide resolved
podzim_2025/lucie-talasova/LT-ukoly3b-sprava_uzivatelu-prakticka_cast.md
Show resolved
Hide resolved
podzim_2025/lucie-talasova/LT-ukoly3b-sprava_uzivatelu-prakticka_cast.md
Show resolved
Hide resolved
5b4b31b to
1e17cd0
Compare
ejegrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zkontrolován úkol 2.
| ## 2. | ||
|
|
||
| Začnu-li (jako uživatel `mh`) v adresáři `/home/mh/data`, které z těchto příkazů mě dostanou do `/home/mh`? | ||
|
|
||
| * **A.** `cd .` | ||
| * **B.** `cd /` | ||
| * **C.** `cd /home/mh` ..... SPRÁVNÁ ODPOVĚĎ | ||
| * **D.** `cd ../..` | ||
| * **E.** `cd ~`............. SPRÁVNÁ ODPOVĚĎ | ||
| * **F.** `cd home` | ||
| * **G.** `cd ~/data/..` .... SPRÁVNÁ ODPOVĚĎ | ||
| * **H.** `cd` .............. SPRÁVNÁ ODPOVĚĎ | ||
| * **I.** `cd ..` ........... SPRÁVNÁ ODPOVĚĎ | ||
| * **J.** otevření nového terminálu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J. je taky správná odpověď, pokud nemáš bash nějak přenastavený, aby dělal něco jiného.
| 3. Pusť `ls -l`. Zjistíš z výpisu, co nový soubor obsahuje? | ||
|
|
||
| Ne. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zjistíš že je prázdný a tedy neobsahuje nic :)
ejegrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zkontrolován úkol 1a a 1b 👍
ejegrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zkontrolován úkol 4 - bash II
| 3. Z kolika přednášek na Pyvech jsou videa? *(Předpokládej že každá přednáška může mít max. 1 video)* | ||
| * *Videa jsou označena `video:`* | ||
| --- | ||
| 🟢 **Odpověď:** | ||
|
|
||
| cd pyvo-data-master/series | ||
| grep -e '-video' */events/20*.yaml | wc -l | ||
|
|
||
| 438 | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady popravdě nevím, jak ti to mohlo fungovat? Používáš fedoru?
grep -e '-video' */events/20*.yaml | wc -l mi nic nevypisuje, ale v případě že odeberu pomlučku z výrazu video, pak funguje (žádný výraz -video se v souborech nevyskytuje):
grep -e "video" */events/20*.yaml | wc -l
Jinak doporučují použít přepínač -w, který bere jen celá slova. S přepínačem -e se nám objeví ve výpisu i další texty, které nechceme. Např.:
praha-pyvo/events/2019-02-20-machine-learning.yaml: Z akce bude [živý videopřenos](https://www.youtube.com/watch?v=1fPS75CYHVo); trpíte-li tedy například nachlazením, trpte v klidu doma a dívejte se na stream.
| 6. Vypiš všechna místa konání Pyv (stačí mít v rámci každého řádku identifikátor jako `artbar`). | ||
| --- | ||
| 🟢 **Odpověď:** | ||
|
|
||
| cd pyvo-data-master/series | ||
| grep -h -o 'venue:[[:space:]]*.*' */events/20*.yaml | sort | uniq | grep -o '[^[:space:]]*$' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady oceňuji řešení, žes získala opravdu jen název místa konání 👍
Jen pro doplnění, stačilo mít odpověď jednodušší formou sort ~/pyvo-data-master/series/*/events/* | uniq | grep venue
| 🟢 **Odpověď:** | ||
|
|
||
| cd pyladies.cz-master/teams | ||
| cat *.yml | grep -- "- name:" |cut -d' ' -f3 | sort | uniq -c | sort -n -r | head -n3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hezký řešení, jen začátek by se dal trošku zjednodušit:
cat *.yml | grep -- "- name:"
na
grep -h name\: ./*
| $ cp *dataset* backup/datasets | ||
| $ cp *calibration* backup/calibration | ||
| $ cp 2015-11-* send_to_bob/all_november_files/ | ||
| $ cp 2015-*-23* send_to_bob/all_datasets_created_on_a_23rd/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tento příkaz by nám zkopíroval i soubor 2015-11-23-calibration.txt. Chtěli bychom přesunout jen datasety,
ejegrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Úkol 5 je těžko čtelný. Soubor podzim_2025/lucie-talasova/LT-ukoly5a-procesy_signaly-vsechny_ps.txt vypadá správně, ale nás spíš zajímá cesta jakými příkazy se k tomu dostaneš. Soubor s logem není úplně ideální, jak posílat výstup.
Finální verze úkolu č. 1: Git
Finální verze úkolu č. 2: Bash I
Finální verze úkolu č. 3: Správa uživatelů