COSC2506 UNIX Essentials for System Administrators
Lab Exercise 1 – Basic Commands & File
System
This laboratory exercises covers topics 3 and 4 that will be tested on the first
practical test.
Power on the virtual machine (Ubuntu Server). Log in as student.
Access the Command Line (Terminal)
Task 1 – Getting Familiar with Linux
Enter these commands at the Linux prompt, and try to interpret the output:
a) who
identifies the user of the operating system
b) uname -a
identifies the operating system and its version of firmware the linux is operating
on
c) id
confirms the identity of the linux user
d) clear
erases displayed contents of the terminal page
e) history
displays recent inputs made by the linux user
f) sleep 5
delays an execution of a command with the integer , “5” being expressed
in seconds
g) uptime
shows how long the operating system has been open for since being
booted up
h) date
displays the current date and time according to the operating system
i) cd ../../..
changes the directory in regards to the command “cd”, “../../../” changes the
directory hierarchy up 3 levels
Task 2 – Linux Commands
1) Consider the command:
$ mv userfile.txt backup
a) What happens if a subdirectory of the current directory called backup exists?
b) What happens if there is no subdirectory called backup?
2) Consider the command:
$ cp myfile1.txt myfile2.txt
Does the above command create a new file?
3) Consider the command:
$ mv myfile1.txt myfile2.txt
Does the above command create a new file?
Task 3 – File Permissions
1) Upon doing an “ls-l” command you will see sequences of 10 characters that look
similar the ones below. Briefly explain what each of these sequences means.
a) –rw-rw-r- -
b) drwxr-x---
2) Create a New File with Default Permissions
Make directory called practice.
Create a new file called newfileperms in the practice directory. New files are created
with default permissions. What command(s) was/were used?
$ _____________________________
What is the size of the file (newfileperms)?
From your home directory list the contents of the practice directory to see the
permissions of newfileperms. What command(s) was/were used?
$ ________________________
What are the default permissions that were assigned to this file?
Permissions:
Who is the owner of the file?
What is the owner’s primary group?
Can a member of the owner’s group rename this file?
Close the Terminal Window.
Shut down your Ubuntu Server virtual machine.