If you can see this check that

  • Javascript is enabled

Shell 101

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

For this tutorial you log in as "alice", using password "secure". Do not try and change to any other account or use sudo, as everything in this tutorial is done with normal user permissions. All files should be created in the default alice directory, which is /home/alice. When you log in you will start in that directory automatically.

To reset all the check buttons from a previous attempt click here

Question 1 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: Ready
 
What day was the 31th of December 2002 UNTESTED

Question 2 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 alice.

Tests: Ready
 
yearfile exists in the right place UNTESTED
Create the calendar for 2005 in yearfile UNTESTED

Question 3 ls

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

Number of files:

Tests: Ready
 
Count files UNTESTED

Question 4 file size

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

Smallest size:

Tests: Ready
 
Smallest size of file UNTESTED

Question 5 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: Ready
 
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 6 copying

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

Tests: Ready
 
Yearfile copied to yearfile2 UNTESTED
Yearfile copied to yearfile3 UNTESTED

Question 7 moving

Change the name of file yearfile3 to thisyear.

Tests: Ready
 
Name changed from yearfile3 to thisyear UNTESTED
File yearfile unharmed UNTESTED

Question 8 deleting

Delete the file yearfile.

Tests: Ready
 
Yearfile has been deleted UNTESTED

Question 9 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: Ready
 
bigfile is a concat of 3 files in order UNTESTED

Centos 7 introPaths | BasicShell | Search
Centos 7 tutorials:intro1 | intro2 | wildcard | permission | pipe | vi | essential | admin | net | SELinux1 | SELinux2 | fwall | DNS | diag | Apache1 | Apache2 | log | Mail
Alma 10 introPaths | BasicShell | Search
Alma 10 tutorials:intro1 | intro2 | wildcard | permission | pipe | vi | essential | admin | net | SELinux1 | SELinux2 | fwall | DNS | diag | Apache1 | Apache2 | log | Mail
Caine 10.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam
Caine 13.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam
Kali 2020-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
Kali 2024-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
UsefulPrivacy Policy | Terms and Conditions

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