-
Notifications
You must be signed in to change notification settings - Fork 3
Vypracovaný úkol z lekce Bash 1 #32
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
Open
DagyDee
wants to merge
1
commit into
main
Choose a base branch
from
dv-ukol-bash-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| Úkoly - Bash I | ||
|
|
||
| 1. Co dělá příkaz ls -v? | ||
|
|
||
| C. Seřadí soubory podle hodnot (víceciferných) čísel v názvech | ||
|
|
||
| A. ls -1 --version # Vypíše verzi programu ls | ||
| B. ls -d # Vypíše jméno aktuálního adresáře, ne jeho obsah | ||
| D. ls -m # Vypíše obsah adresáře kompaktně – jednotlivá jména oddělí čárkou | ||
|
|
||
| 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? | ||
|
|
||
| C. cd /home/mh | ||
| E. cd ~ | ||
| G. cd ~/data/.. | ||
| H. cd | ||
| I. cd .. | ||
|
|
||
| 3. Mám-li níže ukázané adresáře, a pwd vypisuje /home/mh/vec, co ukáže ls -F ../archiv? | ||
|
|
||
| E. original/ pnas_final/ pnas_2/ | ||
|
|
||
| 4. Vypadá-li disk jako v předchozím úkolu a pwd vypisuje /home/mh/archiv, které z těchto příkazů vypíšou pnas_2/ pnas_final/ original/? | ||
|
|
||
| B. ls -r -F | ||
| C. ls -r -F /home/mh/archiv | ||
|
|
||
| 5. Zadej tenhle příkaz: touch novy_soubor.txt | ||
|
|
||
| Co tenhle příkaz udělal? (Nápověda: Použij ls) -> vytvořil soubor "novy_soubor.txt" | ||
| Když se do aktuálního adresáře podíváš grafickým manažerem souborů, ukáže se ti novy_soubor.txt? -> ano | ||
| Pusť ls -l. Zjistíš z výpisu, co nový soubor obsahuje? -> ne | ||
| K čemu slouží příkaz touch? -> k vytvoření nového souboru | ||
|
|
||
| 6. Po tom, co pustíš následující příkazy, si uvědomíš, že soubory sucrose.dat a maltose.dat jsou špatně umístěné – měly by být v adresáři raw. | ||
|
|
||
| mv sucrose.dat maltose.dat ../raw | ||
|
|
||
| 7. Vytvořila sis soubor statsitika.txt, ve kterém máš nějaké výpočty. Ale ve jméně je překlep! Které z těchto příkazů to spraví? | ||
|
|
||
| A. cp statsitika.txt statistika.txt -> budu mít opravenou kopii, původní soubor zůstane | ||
| B. mv statsitika.txt statistika.txt | ||
|
|
||
| 8. Co vypíše ls na konci této sekvence příkazů? | ||
|
|
||
| B. rekombinace | ||
ejegrova marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 9. Zkus napsat co nejkratší příkaz, kterým přesuneš fructose.dat a sucrose.dat do adresáře analyzed/. | ||
|
|
||
| mv fructose.dat sucrose.dat analyzed | ||
|
|
||
| 10. Které z následujících sad příkazů vytvoří tuhle strukturu adresářů? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zkus to ještě jednou, A a D máš dobře, E bohužel správně není. Ale je tam ještě jedna správná možnost. |
||
|
|
||
| A. | ||
| mkdir 2016-05-20 | ||
| mkdir 2016-05-20/data | ||
| mkdir 2016-05-20/data/processed | ||
| mkdir 2016-05-20/data/raw | ||
|
|
||
| D. | ||
|
|
||
| mkdir -p 2016-05-20/data/raw | ||
| mkdir -p 2016-05-20/data/processed | ||
|
|
||
| E. | ||
| mkdir 2016-05-20 | ||
| cd 2016-05-20 | ||
| mkdir data | ||
| mkdir raw processed | ||
|
|
||
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.
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.
2J - otevření nového terminálu
To je taky správně, ikdyž to není vůbec ideální z pohledu práce v terminálu :)