The Shell

Prof. Dr. Mirco Schoenfeld

What this is about

Today, we get to know the shell.

https://itsfoss.com/cowsay/

VirtualBox

  1. Please install a VirtualBox host on your computer.

https://www.virtualbox.org/wiki/Downloads

VirtualMachine

  1. Download a pre-configured virtual machine.
    Or create your own based on Ubuntu 24.04 LTS.

VirtualMachine

By the way, the user account is password protected.

VirtualMachine

  1. Import the virtual machine into your VirtualBox host
    Make sure to check for compatibility of your settings with your host machine, e.g. the guest systems’s base memory.

VirtualMachine

  1. Start the ubuntu-24.04 machine.

The Terminal

Now, please open a terminal and execute some commands.

The Terminal

The Terminal

The Terminal

The Terminal

The Terminal

Task

Copy a text file to your home directory

cp /usr/share/common-licenses/GPL-3 .

and navigate the file.

The Terminal

The Terminal

To exit the less-reader, type q on your keyboard.

Task

Use grep to match regular expressions in the file.

grep "GNU" GPL-3

The Terminal

Task

Execute these commands and find out what they do:

grep -i "license" GPL-3

grep -n "license" GPL-3

grep -v "the" GPL-3

grep -vn "the" GPL-3

Task

Execute these commands and find out what they do:

grep "GNU" GPL-3

grep "^GNU" GPL-3

grep "and" GPL-3

grep "and$" GPL-3

Task

Execute these commands and find out what they do:

grep "..cept" GPL-3

grep "t[wo]o" GPL-3

grep ".ode" GPL-3
grep "[^c]ode" GPL-3

grep "^[A-Z]" GPL-3

Task

For more examples, see

Thanks

https://xkcd.com/196/

Back to Lecture Website