AWS Flashcards

1
Q

Display system information

A

uname -a

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

Display kernel release information

A

uname -r

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

Show version of redhat installed

A

cat /etc/redhat-release

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

Directory contains static files required to boot the system, for example, the Linux kernel

A

/boot/

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

Contains device nodes that represent the following device types:
devices attached to the system;
virtual devices provided by the kernel.

A

/dev/

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

Directory is reserved for configuration files that are local to the machine. It should contain no binaries

A

/etc/

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

Directory controls which file systems export to remote hosts.

A

/etc/exports

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

This directory should only contain libraries needed to execute the binaries in /bin/ and /sbin/

A

/lib/

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

This directory contains subdirectories used as mount points for removable media.

A

/media/

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

This directory is reserved for temporarily mounted file systems, such as NFS file system mounts.

A

/mnt/

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

This directory is normally reserved for software and add-on packages that are not part of the default installation.

A

/opt/

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

This directory contains special files that either extract information from the kernel or send information to it.

A

/proc/

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

This directory stores binaries essential for booting, restoring, recovering, or repairing the system.

A

/sbin/

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

This directory contains site-specific data served by a Red Hat Enterprise Linux system. This directory gives users the location of data files for a particular service such as FTP, WWW, or CVS.

A

/srv/

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

This directory utilizes the new sysfs virtual file system specific to the 2.6 kernel. Contains information similar to that held by /proc/ but displays hierarchical view of device information specific to hot plug devices.

A

/sys/

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

This directory is for files that can be shared across multiple machines. It is usually on its own partition and is mounted read-only.

A

/usr/

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

This directory stores logs, variable data, spool directories, transient and temporary files.

A

/var/

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

Location of most files pertaining to RPM.

A

/var/lib/rpm/

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

Directory containing files used by the Package Updater, including RPM header information for the system.

A

/var/cache/yum/
or
/var/cache/dnf/

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

File systems available

A

EXT3, EXT4, GFS2, XFS, NFS

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

Types of Servers

A

Web, VNC, File server, LDAP, DHCP, Database, SMTP

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

Port number for SMTP?

A

25

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

What does ARP do?

A

ARP used to map IP address to respective MAC address

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

What is DNS?

A

DNS (Domain Naming Service) which translates host name to IP. Host name could be URL, domain name or FQDN (Fully Qualified Domain Name) of any physical/virtual machine. Reverse DNS translates IP to hostname.

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

What is the port number for SSH?

A

22

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

What is the port number for FTP?

A

20-21

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

What is the port number for Telnet?

A

23

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

What is the port number for DNS?

A

53

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

What is the port number for DHCP?

A

67 for server 68 for client reply

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

What is the port number for Kerberos?

A

88 & 464

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

What is the port number for LDAP?

A

389

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

What is the port number for HTTP?

A

80

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

What is the port number for HTTPS?

A

443

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

Graylog requires what other programs?

A

Elasticsearch and MongoDB

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

What kinds of alert callback does Graylog have?

A

SMTP and HTTP

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

What is Ansible?

A

Ansible is a configuration management system. It is used to set up and manage infrastructure and applications. It allows users to deploy and update applications using SSH, without needing to install an agent on a remote system.

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

What’s the use of Ansible?

A

Ansible is used for managing IT infrastructure and deploy software apps to remote nodes.

For example, Ansible allows you to deploy as an application to many nodes with one single command. However, for that, there is a need for some programming knowledge to understand the ansible scripts.

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

What is Continuous Delivery?

A

Continuous delivery is a practice of delivering the software as soon as it developed. In this method, we need to use versioning control system. The software is constantly updated in live production systems.

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

What is the way to access shell environment variables in Ansible?

A

Use the ‘env’ lookup plugin.

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

What are ad-hoc commands?

A

You can think of ad-hoc commands as a way for us to take actions on our hosts without writing a playbook. For example, if we want to reboot all hosts in a particular group(webservers). Then you can write a playbook or simply run a one-off ad-hoc command.

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

Explain modules in ansible

A

Modules in Ansible are idempotent. From a RESTful service standpoint, for the operation to be idempotent, clients can perform the same result by using modules in Ansible. Multiple identical requests become a single request.

There are two different types of modules in Ansible:

Core modules

Extras modules

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

When should you test playbooks and roles?

A

In ansible, Tests can be added either in new Playbooks or to existing Playbooks. Therefore, most of the testing job offers a clean hosting each time. By using this testing methodology, you need to make very little to no code changes.

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

What is an API and how does it work?

A

API stands for Application Programming Interface. An API is a software intermediary that allows two applications to talk to each other. In other words, an API is the messenger that delivers your request to the provider that you’re requesting it from and then delivers the response back to you.

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

Show how long the system has been running + load

A

uptime

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

What is a hash table or hash map

A

It organizes data so you can quickly look up values for a given key.

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

Show system host name

A

hostname

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

Display IP addresses of the host

A

hostname -I

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

Show reboot history

A

last reboot

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

Show current date and time

A

date

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

Show this months calendar

A

cal

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

Display who is online

A

w

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

Who are you logged in as

A

whoami

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

Display CPU information

A

cat /proc/cpuinfo

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

Display memory information

A

cat /proc/meminfo

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

Display free and used memory

A

free -h

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

Display hardware info from the BIOS

A

dmidecode

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

Test for unreadable blocks on SDA

A

badblocks -s /dev/sda

58
Q

Display and manage the top processes

A

top

59
Q

Interactive process viewer and top alternative

A

htop

60
Q

Display processor related statistics

A

mpstat 1

61
Q

Display virtual memory statistics

A

vmstat 1

62
Q

Display I/O statistics

A

iostat 1

63
Q

Display the last 100 syslog messages

A

tail 100 /var/log/messages

64
Q

List all open files on the system

A

lsof

65
Q

List files opened by user

A

lsof -u user

66
Q

Display user and group ids of your current user

A

id

67
Q

Display the last users who have logged onto the system

A

last

68
Q

Create a group named “test”

A

groupadd test

69
Q

Create an account named John, with a comment of “John Smith” and create the users home directory.

A

useradd -c “John Smith” -m john

70
Q

Delete the John account

A

userdel john

71
Q

Add the John account to the sales group

A

usermod -aG sales john

72
Q

List all files in a long listing format

A

ls -al

73
Q

Display present working directory

A

pwd

74
Q

Create a directory

A

mkdir directory

75
Q

Remove (delete) file

A

rm file

76
Q

Remove the directory and its contents recursively

A

rm -r directory

77
Q

Force removal of file without prompting for confirmation

A

rm -f file

78
Q

Forcefully remove directory recursively

A

rm -rf directory

79
Q

Copy file1 to file2

A

cp file1 file2

80
Q

Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directory.

A

cp -r source_directory destination

81
Q

Rename or move file1 to file2. If file2 is and existing directory, move file1 into directory file2.

A

mv file1 file2

82
Q

Create symbolic link to linkname

A

ln -s /path/to/file linkname

83
Q

Create an empty file or update the access and modification times of file.

A

touch file

84
Q

View the contents of file.

A

cat file

85
Q

Browse through a text file

A

less file

86
Q

Display first 10 lines of file

A

head file

87
Q

Display last 10 lines of file

A

tail file

88
Q

Display the last 10 lines of file and “follow” the file as it grows.

A

tail -f file

89
Q

Display your currently running processes

A

ps

90
Q

Display all the currently running processes on the system

A

ps -ef

91
Q

Display process information for processname

A

ps -ef | grep processname

92
Q

Kill process with process ID of pid

A

kill pid

93
Q

Kill all processes named processname

A

killall processname

94
Q

Start program in the background

A

program &

95
Q

Display stopped or background jobs

A

bg

96
Q

Brings the most recent background job to foreground

A

fg

97
Q

Brings job n to the foreground

A

fg n

98
Q

Permissions are octal, 4 2 1, for a max of 7. Given RW- RW- R–, what is this represented in octal format as?

A

664

99
Q

Display all network interfaces and ip address

A

ifconfig -a

100
Q

Display eth0 address and details

A

ifconfig eth0

101
Q

Send ICMP echo request to host

A

ping host

102
Q

Display whois information for domain

A

whois domain

103
Q

Display DNS information for domain

A

dig domain

104
Q

Reverse lookup of IP_ADDRESS

A

dig -x IP_ADDRESS

105
Q

Display DNS ip address for domain

A

host domain

106
Q

Display the network address of the host name.

A

hostname -i

107
Q

DIsplay all local ip addresses

A

hostname -I

108
Q

Download http://domain.com/file

A

wget https://domain.com/file

109
Q

Display listening TCP and UDP ports and corresponding programs

A

netstat -nutlp

110
Q

Create tar named archive.tar containing directory.

A

tar cf archive.tar directory

111
Q

Extract the contents from archive.tar

A

tar xf archive.tar

112
Q

Create a gzip compressed tar file name archive.tar.gz

A

tar czf archive.tar.gz directory

113
Q

Extract a gzip compressed tar file

A

tar xzf archive.tar.gz

114
Q

Create a tar file with bzip2 compression

A

tar cjf archive.tar.bz2 directory

115
Q

Extract a bzip2 compressed tar file

A

tar xjf archive.tar.bz2

116
Q

Search for a package by keyword

A

dnf search keyword

117
Q

Install package

A

dnf install package

118
Q

Display description and summary information about package.

A

dnf info package

119
Q

Install package from local file named package.rpm

A

rpm -i package.rpm

120
Q

Remove/Uninstall package

A

dnf remove package

121
Q

Install software from source code.

A
tar zxvf sourcecode.tar.gz
cd sourcecode
./configure
make
make install
122
Q

Search for pattern in file

A

grep pattern file

123
Q

Search recursively for pattern in directory

A

grep -r pattern directory

124
Q

Find files and directories by name

A

find /home/user -name ‘prefix*’

125
Q

Find files larger than 100MB in /home

A

find /home -size +100M

126
Q

Connect to host as your local username.

A

ssh host

127
Q

Connect to host as user

A

ssh user@host

128
Q

Connect to host using port

A

ssh -p port user@host

129
Q

Secure copy file.txt to the /tmp folder on server

A

scp file.txt server:/tmp

130
Q

Copy *.html files from server to the local /tmp folder.

A

scp server:/var/www/*.html /tmp

131
Q

Copy all files and directories recursively from server to the current system’s /tmp folder.

A

scp -r server:/var/www /tmp

132
Q

Synchronize /home to /backups/home

A

rsync -a /home /backups/

133
Q

Synchronize files/directories between the local and remote system with compression enabled.

A

rsync -avz /home server:/backups/

134
Q

Show free and used space on mounted filesystems

A

df -h

135
Q

Show free and used inodes on mounted filesystems

A

df -i

136
Q

Display disks partitions sizes and types

A

fdisk -l

137
Q

Display disk usage for all files and directories in human readable format

A

du -ah

138
Q

Display total disk usage off the current directory

A

du -sh

139
Q

To go up one level of the directory tree. (Change into the parent directory.)

A

cd ..

140
Q

Go to the $HOME directory

A

cd

141
Q

Change to the /etc directory

A

cd /etc