Linux OS Flashcards

1
Q

How much does a Linux OS cost?

A

Free, Linux is an open source - community supported OS based on the outdated UNIX OS.

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

What Linux terminal command would you use to get help/more information on a command?

A

man commandName
Opens an online manual into the terminal detailing the command and its’ uses.
man - short for online manual

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

How would you display the working directory contents in Terminal on Linux?

A

ls = list directory
Works like dir in Windows CMD line.
ls -l = displays the list with a lot more information (like file size, last modified time, access (read/write mode)). -l stands for long version

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

What command lets you rename a file in Terminal (Linux)?

A

mv
Short for move - by “moving it” you are renaming it
E.g. mv fileName/source newFileName/Destination

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

How to copy a file in Linux terminal?

A

cp
CoPy
cp fileName destinationFileName

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

Delete a file in Terminal? How to delete a directory with files in it?

A

rm fileName
Removes/deletes a file.
rm -R directoryName
Removes a non-empty directory.

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

What permissions would chmod 520 fileName.txt assign?

A

5 = read and execute permissions to Current user
2 = write only permission for Group users
0 = No permissions for Other uses

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

What does chmod command do?

E.g. chmod 710 fileName

A

Change Mode (chmod) Linux command changes the permissions of user types for the file.

E.g. Users can read write and execute the file (7)
Group users can only execute the file (1)
Other users with lower permissions than users or group can’t access the file at all (0)

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

When viewing a directory with ls -l a the top line starts: drwx—— what does this mean. What permissions does each use group (3 characters represents each of the 3 user type groups after the initial character which designates type of file)

A

d = directory, so the top of the active/working directory is a subdirectory
rwx = top level users can read, write and execute the directory/full permissions - 7
— = group level users can’t access it at all/no permissions - 0
— = other/bottom level users can’t access it at all/no permissions -0

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

What would you type to grant group level users permissions permission to read only the following file and no permissions to low level/other users:

drwxrwxrwx thisFile.txt

A

sudo chmod 740 thisFile.txt

7 = all permissions for root-users/top level
4 = read-only permission for group users
0 = no permissions for bottom level users

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

What does sudo do?

A

Allows you to run commands with elevated permissions/as an admin.
sudo - short for Super User DO
Basically elevates your permissions to root user level for a SINGLE command (can do ALL/Super User)

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

How to change file owner and group?

A

sudo chown
sudo elevates access to admin which is required to change file owner/group
chown stands for chANGE ownER

e.g. sudo chown ownerName:groupName file.txt

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

Why doesn’t chown ownerName fileName.txt work to change the mode/owner of a file?

A

Because chown requires sudo before it to run the single command as a root-level user/admin.

sudo prompts you for a superuser password

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

How to run Linux terminal as admin/super user sessions?

A

su
Short for Super User - prompts you for the admin password and then runs all subsequent Terminal commands as Admin/Super-User/elevated permissions

To leave su mode: exit

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

What’s the advanced packaging tool abbreviated to in Linux terminal? And what does it do?

A

apt
Manages the installing and uninstalling of applications on a Linux system.
Requires sudo privileges.

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

How to get out of su mode on Linux terminal?

A

exit
Type exit to leave su mode and go back to being a regular user/non-admin

16
Q

How would you install Opera browser from a Linux Terminal?

How would you uninstall Opera browser from a Linux Terminal?

A

sudo apt-get install opera
apt-get handles the installing/uninstalling of software/applications on Linux - it requires sudo level privileges.

sudo apt-get remove opera

17
Q

What does df command show? What does df -h command show?

A

disk free space (df) shows how many 1kb blocks of drive space you have available/free on your Linux system

Can add -h (human-readable) to display free space in mb/gb/tb

18
Q

Command used to find a text string in a dir on Linux Terminal?

A

grep string directoryAddress

19
Q

How to view Linux task manager (list of running tasks) equivalent?

A

ps
Processes - a list of all active processes on the Linux system and PID (Process ID)
ps -e
-e for everything/everyone’s (all users) use | more to limit it to page by page view

20
Q

What does adding | more after a Linux command do?

A

Displays the given command results one page at a time (instead of jumping through all results to the last one) so it’s more easily readable/manageable.

21
Q

How would you see just the apps/processes using the most resources on a Linux system?

A

top
Shows only the top resource using apps/processes currently running in real-time/live updated. As well as a load/utilisation over time.

22
Q

Linux way of looking up a domain name and finding CNAME’s, linked IP addresses, etc?

A

dig
The dig command works like a more detailed (nslookup on Windows CLI)

23
Q

How to find a file?

A

find
Command searches for a file name.
find . the . specifies to search in current directory

24
Q

Built in Linux notepad/basic file editor command?

A

nano
NaNotepad editor

25
Q

What is the tool that allows a Linux system to support SMB (Server Message Block) File and Printer sharing across a network?

A

samba
Allows Linux to be compatible with SMB (Windows) sharing.

26
Q

How to update a program in Linux CLI?

A

sudo apt-get update This updates the list of available packages and their versions from the rolling repository.
sudo apt-get upgrade This updates each outdated package after user confirms them.

In Terminal.