Introduction to Operating Systems and Commands Flashcards

1
Q

What is an operating system (OS)?

A) A program that manages a computer’s hardware and software
B) A type of hardware component
C) A programming language
D) A type of application software

A

A) A program that manages a computer’s hardware and software

Explanation: An operating system is a crucial software component that manages the hardware and software resources of a computer, providing a stable and consistent way for applications to interact with the hardware.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who is the founder and CEO of Canonical, the company behind the development of the Linux-based Ubuntu operating system?

A) Linus Torvalds
B) Bill Gates
C) Mark Richard Shuttleworth
D) Steve Jobs

A

C) Mark Richard Shuttleworth

Explanation: Mark Richard Shuttleworth is the founder and CEO of Canonical, the company responsible for developing the Ubuntu operating system, which is based on Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following are examples of Linux distributions?

A) Debian, Redhat, Ubuntu, Fedora, CentOS
B) Windows, macOS, Android, iOS
C) Python, Java, C++, Ruby
D) Microsoft Office, Adobe Photoshop, Google Chrome

A

A) Debian, Redhat, Ubuntu, Fedora, CentOS

Explanation: Debian, Redhat, Ubuntu, Fedora, and CentOS are all popular distributions (distros) of the Linux operating system, each with its own features and package management systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is Linux free to use?

A) Yes
B) No

A

A) Yes

Explanation: Linux is free to use and is open-source software, meaning that its source code is available for anyone to view, modify, and distribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a client-server model, what is the first step to set up a client?

A) Set IP address (Static or DHCP)
B) Set PC name and member of domain
C) Authentication
D) Set Security and privilege on server

A

A) Set IP address (Static or DHCP)

Explanation: The first step in setting up a client in a client-server model is to configure the IP address, which can be static or assigned dynamically via DHCP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a central database used for in a client-server model?

A) Authentication
B) User management
C) Security management
D) All of the above

A

D) All of the above

Explanation: A central database in a client-server model is used for authentication, user management, and security management, providing a centralized way to control access and permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which command is used to check the version of Ubuntu installed on a system?

A) sudo apt update
B) cat /etc/lsb-release
C) cd /
D) mkdir folder1

A

B) cat /etc/lsb-release

Explanation: The command cat /etc/lsb-release is used to display the version information of the Ubuntu operating system installed on the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the cd command do in Ubuntu?

A) Updates the package list
B) Changes the current directory
C) Creates a new directory
D) Removes a file

A

B) Changes the current directory

Explanation: The cd (change directory) command is used to navigate between directories in the file system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you create an empty file named draft.txt in the current directory using Ubuntu commands?

A) mkdir draft.txt
B) touch draft.txt
C) rm draft.txt
D) cp draft.txt

A

B) touch draft.txt

Explanation: The touch command is used to create an empty file or update the timestamp of an existing file. In this case, touch draft.txt creates an empty file named draft.txt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which command is used to list the contents of a directory in Ubuntu?

A) ls
B) cd
C) mkdir
D) rm

A

A) ls

Explanation: The ls command is used to list the contents of a directory, displaying files and subdirectories within the specified directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the rm -r command do in Ubuntu?

A) Removes a file
B) Removes an empty directory
C) Removes a directory and all of its contents
D) Copies a file

A

C) Removes a directory and all of its contents

Explanation: The rm -r command is used to remove a directory and all of its contents, including subdirectories and files, recursively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you append text to an existing file in Ubuntu without overwriting its contents?

A) echo “text” > file.txt
B) echo “text”&raquo_space; file.txt
C) cat file.txt
D) touch file.txt

A

B) echo “text”&raquo_space; file.txt

The&raquo_space; operator is used to append text to an existing file without overwriting its contents. In this case, echo “text”&raquo_space; file.txt adds the text to the end of the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you create a new file named example.txt in the current directory using Ubuntu commands?

A) mkdir example.txt
B) touch example.txt
C) rm example.txt
D) cp example.txt

A

B) touch example.txt

Explanation: The touch command is used to create an empty file or update the timestamp of an existing file. In this case, touch example.txt creates a new file named example.txt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the echo command do in Ubuntu?

A) Displays the contents of a file
B) Outputs the specified text to the terminal
C) Creates a new file
D) Deletes a file

A

B) Outputs the specified text to the terminal

Explanation: The echo command is used to display a line of text or a string that is passed as an argument. It can also be used to write text to a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you remove a directory named old_folder and all of its contents in Ubuntu?

A) rm old_folder
B) rmdir old_folder
C) rm -r old_folder
D) cp -r old_folder

A

C) rm -r old_folder

Explanation: The rm -r command is used to remove a directory and all of its contents, including subdirectories and files, recursively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which command is used to move a file named report.txt to a directory named documents in Ubuntu?

A) cp report.txt documents/
B) mv report.txt documents/
C) rm report.txt documents/
D) touch report.txt documents/

A

B) mv report.txt documents/

Explanation: The mv command is used to move or rename files and directories. In this case, mv report.txt documents/ moves the file named report.txt to the documents directory.

17
Q

How do you create multiple directories named dir1, dir2, and dir3 in Ubuntu?

A) mkdir dir1 dir2 dir3
B) rmdir dir1 dir2 dir3
C) touch dir1 dir2 dir3
D) cp dir1 dir2 dir3

A

A) mkdir dir1 dir2 dir3

Explanation: The mkdir command is used to create directories. By specifying multiple directory names, you can create multiple directories at once (e.g., mkdir dir1 dir2 dir3).

18
Q

How do you append the text “Hello, World!” to a file named greetings.txt in Ubuntu without overwriting its contents?

A) echo “Hello, World!” > greetings.txt
B) echo “Hello, World!”&raquo_space; greetings.txt
C) cat “Hello, World!” > greetings.txt
D) cat “Hello, World!”&raquo_space; greetings.txt

A

B) echo “Hello, World!”&raquo_space; greetings.txt

Explanation: The&raquo_space; operator is used to append text to an existing file without overwriting its contents. In this case, echo “Hello, World!”&raquo_space; greetings.txt adds the text to the end of the file.

19
Q

Which command is used to display the contents of a file named data.txt in Ubuntu?

A) ls data.txt
B) cd data.txt
C) cat data.txt
D) touch data.txt

A

C) cat data.txt

Explanation: The cat command is used to display the contents of a file. In this case, cat data.txt displays the contents of the file named data.txt.

20
Q

How do you create a new file named notes.txt and write the text “Meeting at 10 AM” to it in Ubuntu?

A) echo “Meeting at 10 AM” > notes.txt
B) echo “Meeting at 10 AM”&raquo_space; notes.txt
C) cat “Meeting at 10 AM” > notes.txt
D) cat “Meeting at 10 AM”&raquo_space; notes.txt

A

A) echo “Meeting at 10 AM” > notes.txt

Explanation: The > operator is used to write text to a file, overwriting its contents if the file already exists. In this case, echo “Meeting at 10 AM” > notes.txt creates the file notes.txt and writes the specified text to it.

21
Q

How do you display the current system date and time in Ubuntu?

A) time
B) date
C) clock
D) datetime

A

B) date

Explanation: The date command is used to display the current system date and time.

22
Q

Which command is used to display the current user’s username in Ubuntu?

A) whoami
B) who
C) id
D) uname

A

A) whoami

Explanation: The whoami command is used to display the current user’s username.

23
Q

How do you display the system’s hostname in Ubuntu?

A) hostname
B) uname
C) whoami
D) hostnamectl

A

A) hostname

Explanation: The hostname command is used to display the system’s hostname.

24
Q

Which command is used to display detailed information about the system, including the kernel version, in Ubuntu?

A) uname -a
B) hostname
C) whoami
D) date

A

A) uname -a

Explanation: The uname command is a Linux command that provides information about the system’s kernel, operating system, and hardware.

25
Q

What does the cd / command do in Ubuntu?

A) Changes the current directory to the home directory
B) Changes the current directory to the root directory
C) Changes the current directory to the parent directory
D) Changes the current directory to the previous directory

A

B) Changes the current directory to the root directory

Explanation: The cd / command changes the current directory to the root directory of the file system, which is the topmost directory in the hierarchy.

26
Q

How do you change the current directory to your home directory in Ubuntu?

A) cd /
B) cd ~
C) cd ..
D) cd home

A

B) cd ~

Explanation: The cd ~ command changes the current directory to the user’s home directory. The tilde (~) is a shortcut representing the home directory.

27
Q

What does the cd .. command do in Ubuntu?

A) Changes the current directory to the root directory
B) Changes the current directory to the home directory
C) Changes the current directory to the parent directory
D) Changes the current directory to the previous directory

A

C) Changes the current directory to the parent directory

Explanation: The cd .. command moves the current directory up one level in the directory hierarchy, effectively changing to the parent directory.