I3ISU_Opgave1

=Exercise 1.4 Getting acquainted with the terminal=

**Open a terminal and write down which commands you use to:**
//**Display the full path of the current folder:**// pwd //**Get a list of all files and folders in the current folder:**// ls //**Change directory to /home/stud:**// cd /home/stud //**Create a directory /home/stud/test:**// mkdir test //**Change directory to the subdirectory test/:**// cd test //**Create a file text1 containing hello there using kate:**// kate text1 (write //hello there// manually in file that opens and save) //**Create a file text2 containing hello there using echo:**// echo "hello there" > text2 //**Addend 1234567890 to file text1 using echo:**// echo "1234567890" >> text2 //**Dump the contents of text1 to the terminal window:**// cat text1 //**Copy text1 to the directory /tmp:**// cp text1 /tmp //**Delete text1 and text2 in one go:**// rm text1 text2 //**Delete the directory /home/stud/test:**// rmdir test

Exercise 1.4.2 Program control & system poweroff
//**Now kill the program xload you just started:**// kill -9 2800 (-9 ensures "execution" of process. 2800 is the process id, which can be found with the command: //ps ux//.) //**Write a small shell script tha list the current directory. Remember to make your shell script executable using the program chmod.**// code
 * //Get a list of the currently running processes (programs)://** ps
 * //Run program xload in the background://** xload&
 * 1) **//chmod command://** chmod 755 script.sh (755 is to change read, write and execute permissions for user, group and other. script.sh is the name of the file to change rights on.)
 * 2) //**Shell script:**//
 * 1) !/bin/bash


 * 1) Description:
 * 2) Shell script that lists the contents of current directory.

ls

code //**Shutdown the system (now):**// sudo shutdown -h now (-h ensures halt after shutdown)

Exercise 1.4.3 Acquiring system information
//**There is a lot of system information to find in /proc, mention at least 3 different files and what they tell you:**//
 * //Display the current date and time in the terminal://** date
 * //Find the IP address of the network adapter eth0://** ifconfig eth0
 * //Print system information://** uname -a (uname without -a prints systemname. -a prints basic system information)
 * //Print the kernel buffer://** dmesg |less (dmesg gives a lot of information. //Less// makes it easier to browse the information. Space to go to next page for example.)
 * //List all USB devices currently attached to the system://** lsusb
 * //Determine the CPU type by looking in the directory /proc://**
 * 1) Go to /proc: //cd /proc//
 * 2) //ls//
 * 3) Find the file //cpuinfo//
 * 4) //cat cpuinfo//
 * 1) meminfo - displays information about memory and swap usage (swap is a file on the harddrive where the kernel can "save" a running process to free up memory without the process getting killed).
 * 2) partitions - displays partition major and minor numbers. And displays partition names and number of blocks.
 * 3) modules - displays information about all modules loaded by the system. Modules extend the kernel. For example by adding new hardware support.