ISU+Ov1

__**Exercise 1.4.1 **__
 * Open a terminal and write down which commands you use to: **

code PWD code
 * Display the full path of the current folder:   **

code LS code
 * Get a list of all files and folders in the current folder: **

code cd /home/stud code
 * Change directory to /home/stud **

code mkdir test code
 * Create a directory /home/stud/test:  **

code cd test cat > text1.txt Hallo there crtl d code
 * Create a file text1 containing hello there using kate: **

code echo Hallo there >> text2.txt code
 * Create a file text2 containing hello there using echo: **

code echo 1234567890 >> text2.txt code
 * Addend 1234567890 to file text1 using echo:  **

code cat text2.txt code
 * Dump the contents of text1 to the terminal window: **

code cp text1.txt test code
 * Copy test1 to the directory test:  **

code rm text1.txt text2.txt code
 * Delete text1 and text2 in one go:  **

code rm -r test code
 * Delete the directory /home/stud/test: **

__**Exercise 1.4.2 **__ code ps aux code
 * Get a list of the currently running processes (programs): **

code xload& code Om programmet allede køre kan der trykkes ctrl z, programmet vil blive pauset <span style="font-family: Times,serif; font-size: 20px; line-height: 30px;">Hvis man bruger kommando bg vil programmet blive sent til background <span style="font-family: Times,serif; font-size: 20px; line-height: 30px;">Hvis man bruger kommando fg vil programmet blive sent til frontground
 * <span style="font-family: Times,serif; font-size: 15pt;">Run program xload in the background: **

code kill 3195 code <span style="font-family: Times,serif; font-size: 20px;">Nummeret skifter fra gang til gang(det er ID nummer der skal benyttes) <span style="font-family: Times,serif; font-size: 15pt;">For at finde dette nummer benyttes ps aux og programmet findes på listen hvor dets ID vil være.
 * <span style="font-family: Times,serif; font-size: 15pt;">Now kill the program xload you just started: **

code stud@GoldenImage:~$ cat > do.sh PWD chmod +x do.sh (giver rettigheder) ./do.sh code
 * <span style="font-family: Times,serif; font-size: 15pt;">Write a small shell script that lists the current directory. Remember to make you shell script executable using the program chmod.   **
 * 1) !/bin/sh

code Sudo shutdown –h now code <span style="font-family: Times,serif; font-size: 15pt;">"+5" i stedet for "now", forsinker 5 min. code Restart Sudo reboot code
 * <span style="font-family: Times,serif; font-size: 15pt;">Shutdown the system (now): **

__**<span style="font-family: Times,serif; font-size: 15pt;">Exercise 1.4.3 **__ code date code
 * <span style="font-family: Times,serif; font-size: 15pt;">Display the current date and time in the terminal: **

code ifconfig eth0 code <span style="font-family: Times,serif; font-size: 20px; line-height: 30px;">Hvis man ikke vil have specifik IP men alle skriver man blot ifconfig <span style="font-family: Times,serif; font-size: 15pt;">IP: 172.16.158.136
 * <span style="font-family: Times,serif; font-size: 15pt;">Find the IP address of the network adapter eth0: **

code uname -(a, s, n, r, v, m, p, i, o) code <span style="font-family: Times,serif; font-size: 15pt;"> uname -a giver system information
 * <span style="font-family: Times,serif; font-size: 15pt;">Print system information: **

code dmesg|less code
 * <span style="font-family: Times,serif; font-size: 15pt;">Print the kernel buffer: **

code lsusb code
 * <span style="font-family: Times,serif; font-size: 15pt;">List all USB devices currently attached to the system: **

code cd /proc cat cpuinfo code
 * <span style="font-family: Times,serif; font-size: 15pt;">Determine the CPU type by looking the directory /proc: **

1) code cat meminfo code Information om memory og swab usage
 * <span style="font-family: Times,serif; font-size: 15pt;">There is a lot of system information to find in /proc, mention at least 3 different files and what they tell you:  1. 2. 3.  Use Google or other resources to find the command(s) necessary to complete the exercise. **

2) code cat filesystems code Information om filesystemer der er supported af kernen

3) code cat cmdline code Info om filer, brugt til at starte kernen, kan bruges om problemer med at boote

__** Hvad har vi fået ud af denne øvelse: **__ Vi har lært om basic linux comands i terminalen, dette er vigtigt fordi at vi i fremtiden skal skrive til target, hvor der ikke er noget GUI.

Undervejs i øvelsen fik vi ikke nedskrevet hvilke hjemmesider vi benyttede til hjælp men rundt om på nettet findes der meget information ligesom terminalen har en kommande der hedder **man** hvor alle oplysninger om kommandoen kan findes. De hjemmesider som hovudsageligt blev benyttet var linux forums. Én kilde der blev benytte var : []