Open
Conversation
ejegrova
requested changes
Dec 21, 2025
| @@ -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 | |||
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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ů.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prosím o kontrolu úkolu. Děkuji