Skip to content

Conversation

@Dragca
Copy link
Collaborator

@Dragca Dragca commented Nov 3, 2025

Prosím o kontrolu úkolu. Děkuji

@@ -0,0 +1,29 @@
1. Rozdělte tuto tabulku do dvou souborů, root_ps.txt, který bude ve složce root a <jméno uživatele>_ps.txt, který bude ve složce pro uživatele:.
když jsem ve vytvořené složce:
ps -ef | grep -w root > root/root-ps.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tady je vhodné použít ^, která říká že daný výraz je na začátku řádku:
ps -ef | grep -w ^root > root/root_ps.txt

Bez ní se nám počítá do výpisu i například tento proces:
ejegrova 17007 6344 0 16:43 pts/0 00:00:00 grep --color=auto -w root

Comment on lines +11 to +13
2. Teď by nás zajímalo kolik procesů, měl spuštěných root i uživatel, Zapište počet procesů na konec příslušných souborů. :
wc -l root/root-ps.txt >> root/root-ps.txt
wc -l dragca/dragca-ps.txt >> dragca/dragca-ps.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tímto způsobem se nám vypíše i název souboru spolu s počtem procesů. My bychom chtěli mít uložený jen ten počet procesů.

@ejegrova ejegrova added student and removed teacher labels Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants