If you can see this check that

next section prev section up prev page next page

Tutorial 1


Shell 101

User:
Password:

Time to get your hands working on your first Unix commands.

Question 1: Create demo account

To follow along with the examples shown here using the virtual machines is it safer to use an account other than the administration account (root). By pressing the button below a new account is created called "demo", password is also "demo". Log in using this account and you cannot do any damage. If you mess the account up and want to start again, just press the button again.

Once created, you can log into this account using telnet or ssh, logging into the hostname linuxzoo.net. Remember the username is demo and the password is demo. And remember, you cannot break anything using this account! The account begins with an empty directory, so dont be shocked that "ls" shows nothing...

MAKE SURE YOU USE THE USER demo. If you do this with "root" or another account, you will be marked wrong. If you start with the wrong user, make sure you delete any files you created wrongly before changing to demo.

Tests - not attempted
Create an account called demo, password demo UNTESTED

Question 2: cal

Use the cal command to find out which day the 31th of December 2002 was on. cal takes two parameters, the number of the month (e.g. 1 for January, 8 for August) and the year as a 4 digit number (e.g. 1997).

Enter the name of the day in the box below. For Monday enter "Mo", Tuesday is "Tu", Wednesday is "We", etc.

Enter the day:

Tests - not attempted
What day was the 31th of December 2002 UNTESTED

Question 3: cal year

cal can also work with 1 parameter, which is the year. When given a year, it displays a calander for the whole year. Use this feature but redirect the output of cal so that the calander for 2005 is saved to a file called "yearfile" in the home directory of demo.

Tests - not attempted
yearfile exists in the right place UNTESTED
Create the calendar for 2005 in yearfile UNTESTED

Question 4: ls

Use the ls command to see the hidden and normal files you have in the home directory for "demo". Count all the files and directories shown and enter the number below. Include in the counting "." and "..".

Number of files:

Tests - not attempted
Count files UNTESTED

Question 5: file size

Which file in /home/demo (including hidden files) has the smallest size? Enter the size below:

Smallest size:

Tests - not attempted
Smallest size of file UNTESTED

Question 6: append

Use redirection to create a file called "thismonth", containing only this month's current calendar. Then use the date command to append the current date to the end of the same file.

Tests - not attempted
thismonth exists in the right place UNTESTED
The calendar appears to be first UNTESTED
The date appears to be last UNTESTED
The calendar with date appended in thismonth UNTESTED

Question 7: copying

Copy the file yearfile to yearfile2. Copy the file yearfile to yearfile3.

Tests - not attempted
Yearfile copied to yearfile2 UNTESTED
Yearfile copied to yearfile3 UNTESTED

Question 8: moving

Change the name of file yearfile3 to thisyear.

Tests - not attempted
Name changed from yearfile3 to thisyear UNTESTED
File yearfile unharmed UNTESTED

Question 9: deleting

Delete the file yearfile.

Tests - not attempted
Yearfile has been deleted UNTESTED

Question 10: big concat

Concatinate the files "thismonth", "yearfile2" and "thisyear" together to form a single big file called "bigfile". Check that your command worked using more.

Tests - not attempted
bigfile is a concat of 3 files in order UNTESTED


Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 Mail
Caine 6.0: Essentials | Basic | Search | SysIntro | 5a | 5b | 5c | 6 | 7a | 7b | 8a | 8b | WebBrowserA | WebBrowserB | Registry | Browser
Digital Investigation: Editing | Email | Logs | Strength
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2017 Edinburgh Napier University