Kasutaja tarvikud

Lehe tööriistad


materjalid:linux_basics

Erinevused

Siin näed erinevusi valitud versiooni ja hetkel kehtiva lehekülje vahel.

Lõlita võrdlemise vaatele

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
materjalid:linux_basics [2019/04/25 10:07] lucianomaterjalid:linux_basics [2019/04/25 11:06] luciano
Rida 94: Rida 94:
  
  We go to the root folder, and inside etc, we look for all the folders that have the name "hosts"   We go to the root folder, and inside etc, we look for all the folders that have the name "hosts" 
 +
 +Optional:
 +
 + Create a script, which when executed, will print the result directly from having searched for "hosts"
 + The name for the script is script1.sh
 +
  
 ====== Linux basics tasks 3 ====== ====== Linux basics tasks 3 ======
 +
 +===== Redirection =====
 +
 +**cat**
 + If you use the cat command, without specifying any site, you can write in it, it will return what you are saying.
 +
 +(to exit you will have to press the ctrl + d)
 +
 +===== Redirecting the Output=====
 +
 + We use the > symbol to redirect the output of a command.
 +
 +Example:
 +   cat > potato
 +   (now you write what you want and when you finish press ctrl + d)
 +   what you have written in the potato file will be printed
 +   
 +===== Task =====
 +
 +Use the cat command to create a file (for example list1) where you keep the name of about 3 fruits.
 +
 +===== Appending to a file =====
 +
 +We use the symbol >> to add more elements to the file list without deleting the previous ones.
 +
 +===== Task =====
 +
 + Add 3 more fruits to list1 and create another file called list2 where you put another 4 fruits.
 + 
 + Now you will have to join all the fruits in a file called biglist only using the commands that you have learned.
 +
 +===== Redirecting the Input =====
  
  
materjalid/linux_basics.txt · Viimati muutnud: 2019/04/25 13:40 persoon luciano