If you can see this check that

Main Page

Essential Basic Centos


Essentials

User:
Password:

Objectives

Getting started

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

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: Access

To access the system you need to start the image (select the most up to date Centos image available). You then need to log into the image remotely using a variety of methods. You should try to use telnet or ssh, plus the graphical interface VNC. You need to have either ssh installed (e.g. putty.exe) or use the JavaScript ssh. Note putty can only be used if you have a unique public IP, so if you are sharing behind a NAT you must stick with the JavaScript interfaces.

On some highly secured networks, you may not be able to use ssh, but give all of the methods a go and try to get both a command prompt "terminal" interface and VNC working.

The username is "demo" and the password is "demo".
The terminal is started within the graphical interface by clicking on the terminal icon at the bottom of the screen.

Tests - not attempted
Logged in via VNC UNTESTED
Running a terminal in VNC UNTESTED
Running a non-vnc connection (ssh/telnet) UNTESTED

Question 3: Create and Navigate Directories

The "cd" command changes your current directory. On its own it changes it to your HOME directory, otherwise you need to specify a parameter which either is an absolute directory (such as cd /home) or a relative directory (such as cd dir1 which takes you to dir1 in your current working directory).

Type

cd
pwd
This will take you to your home directory and then Print Working Directory.

What is your current working directory? :

Tests - not attempted
Correct cwd UNTESTED

Make three directories in your HOME directory. Name these directories "mydir", "data", and "images".

Tests - not attempted
Three directories created UNTESTED

Change your working directory into "data". Create two more directories in /home/demo/data called "dir1" and "dir2". If you create them in the wrong place delete them using "rmdir".

Tests - not attempted
Two directories created UNTESTED
Not accidentally created in HOME UNTESTED

Change directory into dir2.

What is your current working directory? :

Tests - not attempted
Correct cwd UNTESTED

Change your current working directory to /home/demo. You can either "cd /home/demo" or "cd ..", as ".." means the directory above the current directory in your directory tree. Check with pwd to make sure you are in the right directory. Then try to delete the data directory using "rmdir data". What message to you get back?

Tests - not attempted
Error message displayed UNTESTED

Use the more powerful and dangerous command

rm -rf data
This deletes all files and directories in the data directory, including the data directory itself. Obviously getting the parameter wrong means you can lose a lot of stuff in one go!

Tests - not attempted
Two directories left... UNTESTED

Question 4: The ls command

The "ls" command on its own shows you the contents of the current working directory. However it can also take a number of useful parameters.

Filenames which begin with a "." character do not usually appear when you use "ls". These are called "hidden" files, and they are used for things like application configuration and some GUI state information. They are rarely needed so this is the reason they are hidden from normal "ls".

Use the option "-a" to see the hidden files. View the hidden files in your HOME directory. The file list starts with "." (which is a directory that you can use to describe the current directory in commands) and ".." (which describes the directory above this one in the tree).

What is the first file (in alphabetical order) which appears when you use "-a" in your HOME directory, other than "." and "..". :

Tests - not attempted
Third file when using -a UNTESTED

Use the "-l" option to see a long listing of a file. Get a long listing of "/etc/passwd" and identify its size in bytes. :

Tests - not attempted
Size of /etc/passwd UNTESTED

Question 5: Relative and Absolute

Demonstrate your understanding of relative, absolute, and the use of ".." and "/" and "." in the "cd" command by answering these questions. Try to answer them in your own head, and use the command line only if you are confused. Remember paths beginning with "/" are relative to the top level directory, whereas others are relative to the current directory. ".." takes you up a directory, and things can be seperated with "/" such as "../.." taking you up 2 directories. "." indicates the current directory, and is really only useful where you really need to specify a parameter but you mean to say the current directory. Always supply the SHORTEST solution, remember the answers are CASE SENSITIVE, and if you type spaces in an answerbox where no space should be entered then it will be marked incorrectly.

Consider these commands:

cd /usr/share/doc
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr
cd lib
cd kernel
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../.. 
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../demo
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim/../../lib/kernel
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd /etc/sysconfig
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd 
cd ../../usr/share/doc
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the blank:

cd
cd ../
pwd
Where the "pwd" command prints "/usr/local/lib".
Note this is an example of a RELATIVE pathname parameter to cd, as the parameter does not start with a "/".

Tests - not attempted
Correct blank UNTESTED

Consider these commands and fill in the blank:

cd /usr/share/doc
cd /
cd demo
pwd
Where the "pwd" command prints "/home/demo"
Note this is an example of an ABSOLUTE pathname parameter to cd, as the parameter starts with a "/".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/man
cd 
pwd
Where the "pwd" command prints "/usr/share/perl5/Encode".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/perl
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /etc
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED


Centos 7 intro: Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
Caine 13.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Kali 2020-4: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions

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