vk 35 Kotitehtävät 1

Create following directory structure under your home directory:
~
this
is
a
directory
exercise
Move directory exercise.
Move to directory is.
Move to directory a.

komentopuu1

Copy file /etc/services to directory exercise.

komentopuu2

Explain what mean absolute and relative file path.

-An absolute path is a direct/whole path from the root directory and a relative path is from the working directory, like where you are at that moment.

Using commands

Test command lshw. Find an option which changes output to html format.

-lshw -html
Redirect output to file lshw.html

-lshw -html > lshw.html
Wild cards
List all files in /usr/bin where the first character is z

find1
List all files in /usr/bin/ where the name contains string ab

find2

Pipe

How can you view listing of directory /usr/bin in a scrollable form?

~$ ls /usr/bin | more( or less)

command wc calculates lines, words and characters in a text. How can you use it to count number of files in /usr/bin

-~$ ls /usr/bin | wc -l

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s