Commands for Red Hat-Based Linux and Windows Flashcards

1
Q

What is the command to install a package in Ubuntu (Debian-based)?

A) sudo dnf install <package>
B) apt install <package>
C) winget install package_name
D) yum install <package></package></package></package>

A

B) apt install <package></package>

Explanation: The apt install <package> command is used to install packages in Ubuntu (Debian-based) systems. apt is the package management tool for Debian-based distributions.</package>

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

What is the equivalent command to install a package in Red Hat-based Linux?

A) apt install <package>
B) sudo dnf install <package>
C) winget install package_name
D) yum install <package></package></package></package>

A

B) sudo dnf install <package></package>

Explanation: The sudo dnf install <package> command is used to install packages in Red Hat-based Linux systems. dnf is the package management tool for Red Hat-based distributions.</package>

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

How do you update packages in Ubuntu (Debian-based)?

A) sudo dnf upgrade
B) sudo apt update
C) winget upgrade
D) yum update

A

B) sudo apt update

Explanation: The sudo apt update command in Ubuntu updates the list of available packages and their versions in the system’s package index.

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

Which command is used to list files in a directory in Ubuntu?

A) ls
B) dir
C) list
D) show

A

A) ls

Explanation: The ls command is used to list the contents of a directory in Unix-like operating systems, including Ubuntu.

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

What is the equivalent command to list files in a directory in Windows?

A) ls
B) dir
C) list
D) show

A

B) dir

Explanation: The dir command is used to list the contents of a directory in Windows.

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

How do you copy a file from one location to another in Ubuntu?

A) cp <source></source> <destination>
B) copy <source></source> <destination>
C) mv <source></source> <destination>
D) move <source></source> <destination></destination></destination></destination></destination>

A

A) cp <source></source> <destination></destination>

Explanation: The cp command is used to copy files and directories in Unix-like operating systems, including Ubuntu.

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

What is the equivalent command to copy a file in Windows?

A) cp <source></source> <destination>
B) copy <source></source> <destination>
C) mv <source></source> <destination>
D) move <source></source> <destination></destination></destination></destination></destination>

A

B) copy <source></source> <destination></destination>

Explanation: The copy command is used to copy files in Windows.

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

How do you move a file from one location to another in Ubuntu?

A) cp <source></source> <destination>
B) copy <source></source> <destination>
C) mv <source></source> <destination>
D) move <source></source> <destination></destination></destination></destination></destination>

A

C) mv <source></source> <destination></destination>

Explanation: The mv command is used to move or rename files and directories in Unix-like operating systems, including Ubuntu.

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

What is the equivalent command to move a file in Windows?

A) cp <source></source> <destination>
B) copy <source></source> <destination>
C) mv <source></source> <destination>
D) move <source></source> <destination></destination></destination></destination></destination>

A

D) move <source></source> <destination></destination>

Explanation: The move command is used to move or rename files in Windows.

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

How do you remove a file in Ubuntu?

A) rm <file>
B) del <file>
C) erase <file>
D) delete <file></file></file></file></file>

A

A) rm <file></file>

Explanation: The rm command in Linux and Unix removes files and directories. The basic syntax is rm [option] [file/directory_name]

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

What is the equivalent command to remove a file in Windows?

A) rm <file>
B) del <file>
C) erase <file>
D) delete <file></file></file></file></file>

A

B) del <file></file>

Explanation: The del command is used to delete files in Windows.

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

How do you change the current directory in Ubuntu?

A) cd <dir>
B) chdir <dir>
C) change <dir>
D) goto <dir></dir></dir></dir></dir>

A

A) cd <dir></dir>

Explanation: The cd (change directory) command is used to navigate between directories in Unix-like operating systems, including Ubuntu.

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

What is the equivalent command to change the current directory in Windows?

A) cd <dir>
B) chdir <dir>
C) change <dir>
D) goto <dir></dir></dir></dir></dir>

A

A) cd <dir></dir>

Explanation: The cd (change directory) command is also used in Windows to navigate between directories.

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

How do you display the current directory in Ubuntu?

A) pwd
B) cd
C) dir
D) ls

A

A) pwd

Explanation: The pwd (print working directory) command is used to display the full path of the current directory in Unix-like operating systems, including Ubuntu.

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

What is the equivalent command to display the current directory in Windows?

A) pwd
B) cd
C) dir
D) ls

A

B) cd

Explanation: In Windows, the cd command without any arguments displays the current directory.

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

How do you display running processes in Ubuntu?

A) ps
B) tasklist
C) jobs
D) processes

A

A) ps

Explanation: The ps command is used to display information about running processes in Unix-like operating systems, including Ubuntu.

17
Q

What is the equivalent command to display running processes in Windows?

A) ps
B) tasklist
C) jobs
D) processes

A

B) tasklist

Explanation: The tasklist command is used to display a list of running processes in Windows.

18
Q

How do you kill a process with a specific PID in Ubuntu?

A) kill <PID>
B) taskkill /PID <PID>
C) terminate <PID>
D) end <PID></PID></PID></PID></PID>

A

A) kill <PID></PID>

Explanation: The kill command is used to terminate processes by their PID (Process ID) in Unix-like operating systems, including Ubuntu.

19
Q

What is the equivalent command to kill a process with a specific PID in Windows?

A) kill <PID>
B) taskkill /PID <PID>
C) terminate <PID>
D) end <PID></PID></PID></PID></PID>

A

B) taskkill /PID <PID></PID>

Explanation: The taskkill command with the /PID option is used to terminate processes by their PID in Windows.

20
Q

How do you check disk space usage in Ubuntu?

A) df -h
B) chkdsk
C) diskusage
D) du -h

A

A) df -h

Explanation: The df -h command is used to display disk space usage in a human-readable format in Unix-like operating systems, including Ubuntu.

21
Q

What is the equivalent command to check disk space usage in Windows?

A) df -h
B) chkdsk
C) diskusage
D) du -h

A

B) chkdsk

Explanation: The chkdsk (check disk) command is used to display disk space usage and check the integrity of the file system in Windows.

22
Q

How do you view network information in Ubuntu?

A) ifconfig or ip a
B) ipconfig
C) netstat
D) ping

A

A) ifconfig or ip a

Explanation: The ifconfig command or the ip a command is used to display network configuration information in Unix-like operating systems, including Ubuntu.

23
Q

What is the equivalent command to view network information in Windows?

A) ifconfig
B) ip a
C) ipconfig
D) ping

A

C) ipconfig

Explanation: The ipconfig command is used to display network configuration information in Windows, including IP addresses, subnet masks, and default gateways.

24
Q

How do you ping a host in Ubuntu?

A) ping <host>
B) ping -t <host>
C) ping /host
D) ping -n <host></host></host></host>

A

A) ping <host></host>

Explanation: The ping <host> command is used to send ICMP echo requests to a specified host to check its network connectivity in Unix-like operating systems, including Ubuntu.</host>

25
Q

What is the equivalent command to ping a host in Windows?

A) ping <host>
B) ping -t <host>
C) ping /host
D) ping -n <host></host></host></host>

A

A) ping <host></host>

Explanation: The ping <host> command is also used in Windows to send ICMP echo requests to a specified host to check its network connectivity.</host>

26
Q

How do you add a new user in Ubuntu?

A) adduser <username>
B) sudo useradd <username>
C) net user <username> /add
D) useradd <username></username></username></username></username>

A

A) adduser <username></username>

Explanation: The adduser <username> command is used to add a new user in Unix-like operating systems, including Ubuntu. It is a higher-level utility that provides a more user-friendly interface than useradd.</username>

27
Q

What is the equivalent command to add a new user in Windows?

A) adduser <username>
B) sudo useradd <username>
C) net user <username> /add
D) useradd <username></username></username></username></username>

A

C) net user <username> /add</username>

Explanation: The net user <username> /add command is used to add a new user in Windows.</username>

28
Q

How do you check the system uptime in Ubuntu?

A) uptime
B) systeminfo
C) top
D) ps

A

A) uptime

Explanation: The uptime command is used to display the current time, system uptime, number of users, and system load averages in Unix-like operating systems, including Ubuntu.

29
Q

What is the equivalent command to check the system uptime in Windows?

A) uptime
B) systeminfo
C) top
D) ps

A

B) systeminfo

Explanation: The systeminfo command in Windows provides detailed information about the system, including the system boot time, which can be used to calculate the system uptime.

30
Q

How do you shut down the system immediately in Ubuntu?

A) shutdown now
B) sudo shutdown now
C) shutdown /s /t 0
D) reboot

A

B) sudo shutdown now

Explanation: The sudo shutdown now command is used to shut down the system immediately in Unix-like operating systems, including Ubuntu. The sudo prefix is required to execute the command with superuser privileges.

31
Q

What is the equivalent command to shut down the system immediately in Windows?

A) shutdown now
B) sudo shutdown now
C) shutdown /s /t 0
D) reboot

A

C) shutdown /s /t 0

Explanation: The shutdown /s /t 0 command is used to shut down the system immediately in Windows. The /s option specifies a shutdown, and the /t 0 option sets the time delay to 0 seconds.

32
Q

How do you reboot the system in Ubuntu?

A) shutdown now
B) sudo shutdown now
C) shutdown /r /t 0
D) sudo reboot

A

D) sudo reboot

Explanation: The sudo reboot command is used to reboot the system in Unix-like operating systems, including Ubuntu. The sudo prefix is required to execute the command with superuser privileges.

33
Q

What is the equivalent command to reboot the system in Windows?

A) shutdown now
B) sudo shutdown now
C) shutdown /r /t 0
D) reboot

A

C) shutdown /r /t 0

Explanation: The shutdown /r /t 0 command is used to reboot the system in Windows. The /r option specifies a reboot, and the /t 0 option sets the time delay to 0 seconds.