UNIX Flashcards

1
Q

origins

A

created in AT and T bell labs by denis Richie and ken Thomas in C in early 1970’s -

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

licenses

A

as state-owned company At and T could not directly sell UNIX so sold licenses to other tech companies to create clones - resulting in compatibility issues

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

posix

A

IEEE defined a standard of a portable OS to counter all the different clones created by licenses

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

shells and terminals

A

terminal = system for providing i/o to shell
shell = interactive environment for executing UNIX commands - different types, with different programming environments, sh, bash, tcsh

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

cp

A

copy
creates a new instance of a file in memory independent of the original

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

ln

A

link
creates a new file linking to the original file - changes to one appear in the other - same I values - only in same file system

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

ln -s

A

symbolic link
creates a file pointing to the original file - creates problem when original is removed -

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

permissions

A

each file and directory has permissions for the owner, the group and every one else - ie drwerwerwe is a directory(specified by the first character) owner can read write and execute (next 3 characters), same with the group and everyone else - for dir’s read allows the dir to be listed, write allows files to be added and removed, and execute allows the files to accessed and the directory entered

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

chmod

A

changes user permissions - takes 3 digit number as argument, first specifies user perms, next group, last everyone else - read = 4, write = 2 execute = 1, add numbers for different perms

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

chown

A

change owner - super user required

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

chgrp

A

change group - super user required

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

redirect i/o

A

standard input - read from keyboard
standard output - printed to screen
X < Y - X gets input from Y
X > Y - output of X redirected to Y
X&raquo_space; Y - outut of X appended to end of Y
X 2> Y - X writes errors to Y
X | Y - output of X used as input of Y

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

shell scripts

A

shell provides programming environment - shebang = ~!/bin/bash - requires speech marks to stop wild cards being expanded - requires ./scriptname to run script in current dir

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

environmental variables

A

variables with special meaning:
$HOME = users home directory
$SHELL = location of the shell being used
$TERM = terminal being used
$PATH = contains list of dirs searched for executables in order
set in ~/.profile and /etc/profile
export - used to set environmental variables

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

system dirs

A

/bin - contains essential programs
/usr - contains more system files, should be read only
/var - log files and system file
/etc - config files, i.e passwd
/home - user dirs
/dev - device files, hardrive, terminal etc
user nobody - special user - very low privs - should have no files of own - often used for webserver
setUID - if set on file it always runs with the owners privs

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

mount

A

UNIX has one drive so any external drives must be inserted into the current hierarchical file system,

17
Q

df

A

disk free - displays how much disk is free

18
Q

du | xdu

A

displays which directories use which disk space

19
Q

process

A

a running program - each has a process ID (PID) and parent process (except inet)

20
Q

daemons

A

a process not associated with a particular user

21
Q

process vs kernel space

A

process space - where processes are run with limited privileges isolated from one another
kernel space - where kernel runs with special privileges - isolated from all other processes

22
Q

jobs

A

displays which process run in current shell

23
Q

ps -ef

A

show processes runing in entire system

24
Q

top

A

shows system resource usage

25
Q

managing processes

A

running a command with & at the end or ^z then enter bg will background process - can kill a process by job number (%) process number - if process is not listening use kill -9