0% found this document useful (0 votes)
75 views3 pages

PROG-325 Checkpoint 1-4 Solutions

This document provides instructions for completing a checkpoint on UNIX commands in chapters 1-4 of a PROG-325 course. It includes commands for logging in, checking the current directory, creating directories and files, editing files, viewing file contents, copying and moving files, sorting file contents, backing up files, and removing directories. The student is asked to provide the command for each step.

Uploaded by

Stephen Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views3 pages

PROG-325 Checkpoint 1-4 Solutions

This document provides instructions for completing a checkpoint on UNIX commands in chapters 1-4 of a PROG-325 course. It includes commands for logging in, checking the current directory, creating directories and files, editing files, viewing file contents, copying and moving files, sorting file contents, backing up files, and removing directories. The student is asked to provide the command for each step.

Uploaded by

Stephen Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PROG-325 UNIX

Checkpoint for Chapters 1 - 4


Name: _________________________________________

1.

Log into LINUX

2.

To find out where you are what command do you use? Write the command: pwd

3.

Create a directory called checkpoint. Write the command: mkdir checkpoint

4.

Change the permissions to checkpoint so the Owner had full rights, the group has read and execute
and all others have nothing. Write the command: chmod 750 checkpoint

5.

Change into the checkpoint directory. Write the command: cd checkpoint

6.

Create an empty file called workfile. What three commands can you use to accomplish the
creating of an empty file:

7.

8.

> workfile

touch workfile

vi workfile and esc+:wq

Use vi to create a file called first_names.txt. Put each of these names on a separate line:

Brian

John

Jane

Zoe

Lorraine

Use vi to create a file called last_names.txt. Put each of these names on a separate line:

Candido

Smith

Doe

Ripley

9.

What command can you use to view the contents of the first_names.txt and last_names.txt files
without using vi? Write the command: cat first_names.txt; cat last_names.txt

10. Copy first_names.txt and last_names.txt into a file called names.txt. All the contents from
first_names.txt should be placed first and the contents from last_names.txt should be placed after
the first_names.txt Write the command: cat first_names.txt last_names.txt > names.txt
11. Combine first_names.txt and last_names.txt into a file called full_names.txt. The first record from
first_names.txt should matched up with the first record from last_names.txt and then the second
and so on. Write the command: paste d first_names.txt last_names.txt > full_names.txt
12. Sort the contents for the names.txt file. Write the command: sort names.txt
13. Sort the contents of the names.txt file in reverse order and place into a file called names_sort.txt.
Write the command: sort r names.txt > names_sort.txt
14. Copy the names_sort.txt file to names_sort.txt.backup. Write the command: cp names_sort.txt
names_sort.txt.backup
15. Create a backup directory within the checkpoint directory. Write the command: mkdir backup
16. Copy all the txt files into the backup directory. Write the command: cp *.txt backup
17. Within the backup directory rename names_sort.txt to names_sorted.txt. Write the command:
mv backup/names_sort.txt backup/names_sorted.txt
Or
cd backup
mv names_sort.txt names_sorted.txt
18. With one command rename the checkpoint/names_sort.txt.backup to names_sorted.backup and
place into the backup directory. Write the command: mv names_sort.txt.backup
backup/names_sorted.backup
19. You are done with the backup directory and what to get rid of it and everything in it. There two
ways to do it. Write the commands:
1.

rm r backup

2.

cd backup
rm *
cd ..

rmdir backup
3.

rmdir r backup

You might also like