You are on page 1of 5

Topic 1 : Disk operating system

1. A) Syntax
- The syntax of a command refers to the rules in which the command must be run in
order for a piece of software to understand it.

B) Paths
- Tells DOS which directories should be searched for external commands after DOS
searches you’re working directory.

C) Switches
- A switch is a code, or parameter, that modifies a command. DOS switches use a
forward slash (not a backslash) followed by some letter, digit or code.

D) Command line statements


- Interacting with a computer program where the user (or client) issues commands to
the program in the form of successive lines of text (command lines).

E) Batch files
- A batch file is simply a text file that you can create by using unformatting text editor
tools the EDIT command in MS-DOS.

2. (a) Directory command: lists the names of files and directories in the current
directory.
Ex: “com*” >> it will display files such as computer.txt, communication.doc and
compile.txt.
“communication?.doc” >> it will display files such as communication.doc.

(b) Copy command: copy files to another location.


Ex: “sam*” >> it will copy files such as sample.txt, sampling.txt and Samsung.doc.
“sampl?.txt” >> it will copy files such as sample.txt and sampl1.txt.

(c) Erase command: deletes specified files.


Example: “doc*” >> it will delete files such as document.txt, doc1.txt and doctor.doc.
“doc?.txt” >> it will delete file such as doc1.txt.

3. Windows, Linux and macOS


4. C:\Users\uthm > color 0A
The first character represents background colour and the second character represents
foreground colour.

Code(Hex) color
0 Black
1 Blue
2 Green
3 Cyan
4 Red
5 Magenta
6 Yellow/brown
7 White
8 Grey
9 Bright blue
A Bright green
B Bright cyan
C Bright red
D Bright magenta
E Bright yellow
F White

5. file name and its extension.


A) 8 characters for filename
B) 3 chars for extension
C) Cannot use special characters in file name as \ / : * ? " < > |

6.
Copy Xcopy

- Specifies the directory and/or filename for - Specifies the location and/or name of new
the new file(s). files.
-Copies one or more files to another - Copies files and directory trees.
location.
- Example: -Example:
>copy “D:\quiz1.xls” >xcopy “D:\Xiaomi” “D:\Xiaomi\Xiaomi
“D:\Xiaomi\quiz1.xls” Copy”
Copy:

Xcopy:

7. Using the appropriate command, explain how to solve the following situations.

(a) to combine “quiz1.xls”, “quiz2.xls” and “quiz3.xls” into one file named “report.xls”
in the current directory:
C:\> copy D:\quiz1.xls + quiz2.xls + quiz3.xls D:\report.xls
(b) to combine all files in the current directory on the current drive that have the
extension “.xls” into one file named “combined.xls”:
C:\> copy D:\*.xls + *.xls + *.xls D:\combined.xls

(c) to combine first all files with the “.txt” extension, then all files with the “.doc”
extension and all files with the “.xls” extension into one file named “combined.doc”:
C:\> copy D:\*.xls + D:\*.doc + D:\*.txt D:\combined.doc

You might also like