If you can see this check that

           prev section up prev page next page

Tutorial 3


Wildcards

User:
Password:

Using wildcards.

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

Question 1: Update demo account

If you have just completed all the previous tutorials you need not use this setup button. However, if you have skipped part or all of the previous tutorial questions, or when you ran your virtual machine the demo account was missing, then the button below will create the demo account and create the files which the previous tutorials would have had you create.

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...

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

Question 2: Wild copy

In the demo account, cd to the home directory (/home/demo). From there copy all files using the * wildcard that contain the word file in the filename into the work directory. Confirm this using ls.

Tests - not attempted
Wildcard copy did copy the files UNTESTED
At least 1 file can be copied UNTESTED

Question 3: Duplicate thismonth

Copy the file thismonth to the letters directory and rename it let1.doc. Change the current working directory to the letters directory and copy let1.doc to let2.doc. Copy once more let1.doc to let3.doc. Confirm this yourself using the ls command.

Tests - not attempted
let1.doc successfully copied UNTESTED
let2.doc successfully copied UNTESTED
let3.doc successfully copied UNTESTED

Question 4: Copy and rename

Copy using the ? wildcard the three files let1.doc, let2.doc, and let3.doc from the letters directory to the work/misc directory. Once copied, rename the new files (the ones in the misc directory) into rpt1.doc, rpt2.doc, and rpt3.doc. When renaming, you have to do this explicitly and not try to use a wildcard. It would appear at first that a wildcard could make the renaming easier, but it turns out to be ridiculously hard to use a wildcard in this case.

Tests - not attempted
letters/let1.doc -> work/misc/rpt1.doc UNTESTED
letters/let2.doc -> work/misc/rpt2.doc UNTESTED
letters/let3.doc -> work/misc/rpt3.doc UNTESTED

Question 5: Square Brackets

Using square brackets, move all the files from the misc directory that contain the numbers 2 or 3 into the scripts directory.

Tests - not attempted
At least 1 file is moved UNTESTED
work/misc has no files with 2 or 3 in it UNTESTED

Question 6: rm

Remove all files beginning with the letter "r" from the scripts directory. Use the -i option to see what you are about to delete before then agreeing to delete the files involved.

Tests - not attempted
No files starting with r in scripts UNTESTED

Question 7: Hard link

Create a hard link in progs called biglink, which is a hard link to the bigfile file in your home directory.

In "ls -l bigfile" the hard link count should be 2. If you make mistakes and create links with the wrong name or in the wrong place you will be marked wrong until you fix the problem.

Tests - not attempted
Hard link of bigfile UNTESTED

Question 8: Soft link

Create a soft link in progs called mylink, which is a relative soft link to the thismonth file in your home directory.

Tests - not attempted
mylink is a soft link UNTESTED
Soft link is relative UNTESTED
Soft link is actually points to thismonth UNTESTED

Question 9: Soft link - absolute

Create a soft link in progs called mylink2, which is a absolute soft link to the thismonth file in your home directory.

Tests - not attempted
mylink2 is a soft link UNTESTED
Soft link is absolute UNTESTED
Soft link is actually points to thismonth 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 |
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-2023 Edinburgh Napier University