Topic 5 - The command-line interface Flashcards

1
Q

what is the outcome of typing

Grep ‘sat’ -I ‘datefile’

into a linux terminal

A

in a linux terminal:

this will search for the text pattern ‘sat’ while ignoring letter cases in the file named ‘datefile’

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

this is used to redirect the STDOUT (standard out stream) of a command to a file

A

what is the > symbol used for

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

Standing for ‘global regular expression print’. is a tool for finding a given text pattern in a given text.

Text can be pipelined into this command or can be held inside a file

A

describe the linux

grep

command

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

give a description of the linux

cat

command

A

this command will concatenate files and print on the standard output

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

what is the outcome of typing

Touch existing-filename

into a linux terminal

A

in a linux terminal:

this will update the access and modification timestamps of the given filename

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

what is the name and purpose of the ~ symbol in linux

A

in linux this is called a

tilde and points / references your home directory

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

in a linux terminal:

this will redirect the output from the date command into the given filename, creating a new file if it does not exist

A

what is the outcome of typing

Date > filename

into a linux terminal

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

in a linux terminal:

this will update the access and modification timestamps of the given filename

A

what is the outcome of typing

Touch existing-filename

into a linux terminal

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

The OS is also able to optimize this efficiently since the output of one command can be written to main memory and as soon as data starts to arrive the other command can start to consume it without the need for the first command to finish execution

A

how can the operating system

optimize pipelining

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

the shell used on this was named sh (bourne shell) as was written by stephen bourne

A

what was the shell used on UNIX systems called and who created it

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

what is the outcome of typing

Rm filename -f

into a linux terminal

A

in a linux terminal:

this will suppresses the prompt confirming removal of write protected files and overrides the write protection. in turn deleting the file

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

what is the outcome of typing

Cp my-file my_directory

into a linux terminal

A

in a linux terminal:

this will copy the file my-file into the directory my-directory

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

this is a file that contains the paths of available shells on the linux system

A

describe the linux

/etc/shells

file

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

when this occurs the operating system will set:

  • the input stream as the keyboard
  • the output stream as the terminal window
A

when a terminal is opened what are the default input and output streams configured by the operating system

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

give a description of the linux

mv

command and how it works

A

in a linux terminal:

This is used to move files and directories. If the source file given is moved to the same location this command then renames the file using the destination

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

• it prompts a user to type a command line
• it deals with editing within the line, accepting the line when Enter is pressed
• some special characters are picked out and handled specially, such as:
◦ quotation marks preserve spaces but are themselves stripped out
◦ > and ◦ wildcards such as * cause filenames to be expanded
• the completed command line is broken into pieces (tokens) by spaces
• the first token on the line is taken as the command
• if the command is built-in, then:
◦ the corresponding action is taken
• otherwise the file system is searched for a matching filename
• if a matching file is found, then:
◦ the type of file is determined
◦ if the file is a script, then:
– the script commands are interpreted recursively line by line
– until the end of the file
◦ if the file is an executable program:
– a system call obtains a chunk of memory from the memory management module
– a system call loads the contents of the program from the file system into that memory
– the remainder of the command-line arguments are copied to it
– a final system call is made to execute the program, relinquishing control of the processor through a context switch
– until the program ends and a context switch returns control to the shell
• else if no matching file is found, report an error

This process is then repeated.

A

how the linux cli operates

(come back to this at the end of the module)

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

this will redirect the STDOUT (standard output) of the command to a given file.

  • If the file contains content it will be overwritten
  • if the file does not exist it will be created
A

in a windows and linux terminal what is the (>) used for and 2 considerations to take into account before its use

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

in a linux terminal:

this will make a new directory with the name as the value given

A

what is the outcme of typing

Mkdir value

into a linux terminal

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

this can be used to give STDIN (standard input) to a command from a file for example

A

in a windows or linux terminal what does the (

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

in a linux terminal:

this will tell you the file type of the filename you have given

A

what is the outcome of typing

File filename

into a linux terminal

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

what is the outcome of typing

Ls -l

into a linux terminal

A

in a linux terminal:

this will output detailed information about the contents of the directory

note

  • if the first character of a line is a (-) it represents a file
  • if the first character of a line is a (d) it represents a directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Because linux was developed from UNIX many of the linux shells maintain traditions from UNIX such as syntax this in turn has kept compatibility alive between linux systems

also many of the linux shells are derivitives of the unix sh shell although they will contain many new features

A

why are commands from UNIX seen in linux

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

what is the outcome of typing

Touch non-existing filename -c

into a linux terminal

A

in a linux terminal:

this will find no file and will also not create a new file. execution ends silently

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

this linux shell

  • is a widely used shell in linux distributions
  • maintains compatibility with the original sh shell
  • maintains compatibility with the original sh shell
A

give three points about the linux:

Bash (bourne again shell)

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

what is the linux

find

command used for

A

in linux terminal:

This is used to search for files in a directory

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

this is a file that contains information about the systems processor

A

describe the linux

/proc/cpuinfo

file

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

this is an accronym for:

bourne again shell

A

what does

bash

stand for

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

give 3 reasons as to why many OSs share the same commands which may also have the same or similar functionality

A

the reason this occurs are

  • Developers have been influenced by UNIX and so the UNIX commands and syntax still exist
  • Open source software means that a software can be built and then intergrated easily to another OS. Since many cli commands are external programes this is how this is achieved
  • compliance with POSIX
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

give an overview description of what

recursion

is

A

This is where a function or process calls itself. It is used with many shell commands for actions such as searching through directories

example

function look_for_key(box) {

for (item in box) {

if (item.is_a_box()) {

look_for_key(item);

} else if (item.is_a_key()) {

console.log(“found the key!”)

}

}}

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

what is the > symbol used for

A

this is used to redirect the STDOUT (standard out stream) of a command to a file

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

describe what

POSIX (Portable Operating System Interface)

is

A

this is a set of standards and utilities maintained by IEEE that aims to maintain compatibility between operating systems. in turn meaning that an application can be run on either OS

The standards can define common APIs as well as how certain operating system tasks tasks should be handled.

Many OSs have some compliance with this

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

this will redirect the STDOUT (standard output) of a command to a given file.

  • If the file contains content it will be preserved and the output will be appended to the end of the files content
  • if the file does not exist it will be created
A

in a linux or windows terminal what does the (>>) achieve and what are 2 considerations before its use

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

in a linux or windows terminal what does the (>>) achieve and what are 2 considerations before its use

A

this will redirect the STDOUT (standard output) of a command to a given file.

  • If the file contains content it will be preserved and the output will be appended to the end of the files content
  • if the file does not exist it will be created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

in a linux terminal:

this will search for the text pattern ‘sat’ while ignoring letter cases in the file named ‘datefile’

A

what is the outcome of typing

Grep ‘sat’ -I ‘datefile’

into a linux terminal

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

in linux this command is used when we would like to switch user accounts this includes logging in to the root account. this command is known as (switch user)

A

describe the linux

su

command

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

why are commands from UNIX seen in linux

A

Because linux was developed from UNIX many of the linux shells maintain traditions from UNIX such as syntax this in turn has kept compatibility alive between linux systems

also many of the linux shells are derivitives of the unix sh shell although they will contain many new features

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

in a linux terminal:

this will output detailed information about the contents of the directory

note

  • if the first character of a line is a (-) it represents a file
  • if the first character of a line is a (d) it represents a directory
A

what is the outcome of typing

Ls -l

into a linux terminal

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

what is the

root account

on linux

A

this is effectively the administrator account. this account has full control over the system and can carry out any commands

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

give an answer to each of these points concerning

nano

  • what is it
  • under what license is it released
  • what would be one appropriate situation for using this
A
  • what is it - This is a simple text editor that can be executed and ran inside the terminal
  • under what license is it released - It is released under the GNU general public license meaning that end users can run, study, share and modify the software
  • what would be one appropriate situation for using this - Linux has many configuration files written in plain text and using an editor such as this is the recommended approach to take when editing such files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

in linux this is called a

tilde and points / references your home directory

A

what is the name and purpose of the ~ symbol in linux

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

the syntax is

Grep ‘string’ options ‘file or files’

A

what is the syntax for

grep

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

in a linux terminal:

This is used to move files and directories. If the source file given is moved to the same location this command then renames the file using the destination

A

give a description of the linux

mv

command and how it works

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

in a linux terminal:

this will find no file and will also not create a new file. execution ends silently

A

what is the outcome of typing

Touch non-existing filename -c

into a linux terminal

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

what does

POSIX

stand for

A

this is an accronym for

Portable Operating System Interface

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

in linux terminal:

This is used to search for files in a directory

A

what is the linux

find

command used for

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

when this occurs:

  1. the command - is not aware of anything being different or used
  2. the shell/terminal - will interpret that this has been used and send the appropriate commands to the OS
  3. the OS - will receive notification/commands from the shell and switch the STDOUT/STDIN appropriately
A

when using redirection or piping what are each of these aware of

  1. the command
  2. the shell/terminal
  3. the OS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

2 options in linux that provide this are

-i - known as interactive will prompt the user before each action

-v - known as verbose will print to screen confirmation messages

A

linux commands are executed silently. meaning that unless there is an error or STDOUT then no feedback is given.

what are 2 options that can provide feedback/security

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

give 2 points about the linux

Dash (debian almquist shell)

A

this linux shell:

  • is an extremely lightweight shell
  • maintains compatibility strictly with the sh shell (can be used in place of the sh shell. this maintains compatibility with older scripts that may call sh)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

give a description of the linux

touch

command

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

what is the outcme of typing

pwd

into a linux terminal

A

in a linux terminal:

this prints the current working directory

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

does the sh shell exist on linux

A

this can be called by scripts on linux but is not strictly available on linux.

instead it is available to call but is symbolically linked to the dash shell

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

this command is used by default to remove files. it however can also be used to remove directories in such a case the -r (recursive) option must be used

A

give a description of the

rm

command and how it handles directories

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

the reason this occurs are

  • Developers have been influenced by UNIX and so the UNIX commands and syntax still exist
  • Open source software means that a software can be built and then intergrated easily to another OS. Since many cli commands are external programes this is how this is achieved
  • compliance with POSIX
A

give 3 reasons as to why many OSs share the same commands which may also have the same or similar functionality

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

describe the linux

grep

command

A

Standing for ‘global regular expression print’. is a tool for finding a given text pattern in a given text.

Text can be pipelined into this command or can be held inside a file

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

give a description of the

rm

command and how it handles directories

A

this command is used by default to remove files. it however can also be used to remove directories in such a case the -r (recursive) option must be used

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

within this utility:

  1. up/down arrow keys - can be used to navigate the text
  2. spacebar - is used to view the next page
  3. h - is used to get help about the utility
  4. q - is used to quit the utility
A

regarding the linux

less utility

what do each of these actions achieve

  1. up/down arrow keys
  2. spacebar
  3. h
  4. q
57
Q

what is the outcome of typing

mv my-file my-file2

into a linux terminal

A

in a linux terminal:

this will rename the file my-file to my-file2

58
Q

this is made possible because most commands will use text as thier input and output.

this means that commands can be used flexibly with each other since they are all using text format

A

what makes pipelining between commands possible

59
Q

regarding the linux

less utility

what do each of these actions achieve

  1. up/down arrow keys
  2. spacebar
  3. h
  4. q
A

within this utility:

  1. up/down arrow keys - can be used to navigate the text
  2. spacebar - is used to view the next page
  3. h - is used to get help about the utility
  4. q - is used to quit the utility
60
Q

what is the outcome of typing

Cat file1 file2 file3

into a linux terminal

A

in a linux terminal:

this will print each of the given files to the terminal in the given order

61
Q

This is where a function or process calls itself. It is used with many shell commands for actions such as searching through directories

example

function look_for_key(box) {

for (item in box) {

if (item.is_a_box()) {

look_for_key(item);

} else if (item.is_a_key()) {

console.log(“found the key!”)

}

}}

A

give an overview description of what

recursion

is

62
Q

in a linux terminal:

this will navigate you to the directory/path entered

A

what is the outcome of typing

Cd path

into a linux terminal

63
Q

what is the outcome of typing

Nano filename

into a linux terminal

A

in a linux terminal:

this will open the file in the nano text editor ready for reading and editing

64
Q

this is effectively the administrator account. this account has full control over the system and can carry out any commands

A

what is the

root account

on linux

65
Q

this directory contains linux configuration files

A

describe the linux

/etc

directory

66
Q

what is the outcome of typing

Sudo su root

into a linux terminal

A

this will switch the shell to the root account and give the user full control of the system.

root can be omitted since linux will assume root

67
Q

This can be dissected into several parts

  1. The username
  2. The hostname
  3. The current directory
  4. Privilege. $ for normal privileges, # for superuser privileges

example

pi@raspberry:~ $

  1. The user is called pi
  2. The computer name / hostname is raspberry
  3. They are in the home directory
  4. They have normal privileges
A

what are the 4

parts of a linux prompt

68
Q

what are the 4

parts of a linux prompt

A

This can be dissected into several parts

  1. The username
  2. The hostname
  3. The current directory
  4. Privilege. $ for normal privileges, # for superuser privileges

example

pi@raspberry:~ $

  1. The user is called pi
  2. The computer name / hostname is raspberry
  3. They are in the home directory
  4. They have normal privileges
69
Q

how do you switch between shells on a linux system

A

achieving this is simply a case of entering the shell name into the termial

70
Q

give 2 points about the linux:

Zsh (z shell)

A

this linux shell:

  • is compatible with bash but offers more customisation
  • macOS has recently replaced bash with this shell
71
Q

this is an abbreviation of

‘global regular expression print’

A

what does

grep

stand for

72
Q

what does

bash

stand for

A

this is an accronym for:

bourne again shell

73
Q

what is the outcome of typing

Cat file1 file2 file3 > file4

into a linux terminal

A

in a linux terminal:

this will concatenate each of the files given and then redirect the output to the file given

74
Q

how can the operating system

optimize pipelining

A

The OS is also able to optimize this efficiently since the output of one command can be written to main memory and as soon as data starts to arrive the other command can start to consume it without the need for the first command to finish execution

75
Q

what is the outcome of typing

Find /etc -name ‘*.conf’

into a linux terminal

A

this will search in the /etc directory for any files that have a name ending with ‘.conf’

76
Q

in a linux terminal:

this will print each of the given files to the terminal in the given order

A

what is the outcome of typing

Cat file1 file2 file3

into a linux terminal

77
Q

achieving this is simply a case of entering the shell name into the termial

A

how do you switch between shells on a linux system

78
Q

in a linux terminal:

this will copy the file my-file into the directory my-directory

A

what is the outcome of typing

Cp my-file my_directory

into a linux terminal

79
Q

in a linux or windows terminal what is the ( | ) used for

A

know as the pipeline. this allows you to redirect or ‘pipe’ the STDOUT (standard output stream) of one command to the STDIN (standard input stream) of another command

80
Q

what is the outcme of typing

Mkdir value

into a linux terminal

A

in a linux terminal:

this will make a new directory with the name as the value given

81
Q

what is the outcome of typing

File filename

into a linux terminal

A

in a linux terminal:

this will tell you the file type of the filename you have given

82
Q

what is the syntax for

grep

A

the syntax is

Grep ‘string’ options ‘file or files’

83
Q

this will search in the /etc directory for any files that have a name ending with ‘.conf’

A

what is the outcome of typing

Find /etc -name ‘*.conf’

into a linux terminal

84
Q

this linux shell:

  • uses similar loops, conditionals and expressions to the language C
A

give a point about the linux

Csh (c shell)

85
Q

describe the linux

su

command

A

in linux this command is used when we would like to switch user accounts this includes logging in to the root account. this command is known as (switch user)

86
Q

these are:

. - this points to the directory itself

.. - this points to the parent directory

A

what are the 2

hidden directories that every linux directory will have

87
Q

in a linux terminal:

this will rename the file my-file to my-file2

A

what is the outcome of typing

mv my-file my-file2

into a linux terminal

88
Q

what is the outcome of typing

Cd path

into a linux terminal

A

in a linux terminal:

this will navigate you to the directory/path entered

89
Q

describe the linux

less

command and a use case

A

This is a pager utility that allows you to view voluminous data either line by line or a page at a time.

If a command outputs a lot of data then piping it into this will help you read and navigate the text

90
Q

linux commands are executed silently. meaning that unless there is an error or STDOUT then no feedback is given.

what are 2 options that can provide feedback/security

A

2 options in linux that provide this are

-i - known as interactive will prompt the user before each action

-v - known as verbose will print to screen confirmation messages

91
Q

give a point about the linux

Csh (c shell)

A

this linux shell:

  • uses similar loops, conditionals and expressions to the language C
92
Q

in a windows and linux terminal what is the (>) used for and 2 considerations to take into account before its use

A

this will redirect the STDOUT (standard output) of the command to a given file.

  • If the file contains content it will be overwritten
  • if the file does not exist it will be created
93
Q

when using redirection or piping what are each of these aware of

  1. the command
  2. the shell/terminal
  3. the OS
A

when this occurs:

  1. the command - is not aware of anything being different or used
  2. the shell/terminal - will interpret that this has been used and send the appropriate commands to the OS
  3. the OS - will receive notification/commands from the shell and switch the STDOUT/STDIN appropriately
94
Q

when a terminal is opened what are the default input and output streams configured by the operating system

A

when this occurs the operating system will set:

  • the input stream as the keyboard
  • the output stream as the terminal window
95
Q

in a linux terminal:

this will remove the given directory but only ever if it is empty

A

what is the outcome of typing

Rmdir directory

into a linux terminal

96
Q

how can we quickly view the available shells on a linux system via the terminal

A

this can be achieved by entering

cat /etc/shells

97
Q

in a linux terminal:

this will suppresses the prompt confirming removal of write protected files and overrides the write protection. in turn deleting the file

A

what is the outcome of typing

Rm filename -f

into a linux terminal

98
Q

this command will concatenate files and print on the standard output

A

give a description of the linux

cat

command

99
Q
  • what is it - This is a simple text editor that can be executed and ran inside the terminal
  • under what license is it released - It is released under the GNU general public license meaning that end users can run, study, share and modify the software
  • what would be one appropriate situation for using this - Linux has many configuration files written in plain text and using an editor such as this is the recommended approach to take when editing such files
A

give an answer to each of these points concerning

nano

  • what is it
  • under what license is it released
  • what would be one appropriate situation for using this
100
Q

This is a pager utility that allows you to view voluminous data either line by line or a page at a time.

If a command outputs a lot of data then piping it into this will help you read and navigate the text

A

describe the linux

less

command and a use case

101
Q

how the linux cli operates

(come back to this at the end of the module)

A

• it prompts a user to type a command line
• it deals with editing within the line, accepting the line when Enter is pressed
• some special characters are picked out and handled specially, such as:
◦ quotation marks preserve spaces but are themselves stripped out
◦ > and ◦ wildcards such as * cause filenames to be expanded
• the completed command line is broken into pieces (tokens) by spaces
• the first token on the line is taken as the command
• if the command is built-in, then:
◦ the corresponding action is taken
• otherwise the file system is searched for a matching filename
• if a matching file is found, then:
◦ the type of file is determined
◦ if the file is a script, then:
– the script commands are interpreted recursively line by line
– until the end of the file
◦ if the file is an executable program:
– a system call obtains a chunk of memory from the memory management module
– a system call loads the contents of the program from the file system into that memory
– the remainder of the command-line arguments are copied to it
– a final system call is made to execute the program, relinquishing control of the processor through a context switch
– until the program ends and a context switch returns control to the shell
• else if no matching file is found, report an error

This process is then repeated.

102
Q

describe the linux

/etc/shells

file

A

this is a file that contains the paths of available shells on the linux system

103
Q

in a linux terminal:

this will move the file my-file into the directory my_directory

A

what is the outcome of typing

mv my-file my_directory

into a linux terminal

104
Q

what does

grep

stand for

A

this is an abbreviation of

‘global regular expression print’

105
Q

in a linux terminal:

this will open the file in the nano text editor ready for reading and editing

A

what is the outcome of typing

Nano filename

into a linux terminal

106
Q

what is the outcome of typing

Touch non-existing filename

into a linux terminal

A

in a linux terminal:

will create a new file with the name of the given filename

107
Q

what is the outcome of typing

mv my-file my_directory

into a linux terminal

A

in a linux terminal:

this will move the file my-file into the directory my_directory

108
Q

in a linux terminal:

will create a new file with the name of the given filename

A

what is the outcome of typing

Touch non-existing filename

into a linux terminal

109
Q

describe the linux

/proc/cpuinfo

file

A

this is a file that contains information about the systems processor

110
Q

describe the linux

/etc

directory

A

this directory contains linux configuration files

111
Q

what was the shell used on UNIX systems called and who created it

A

the shell used on this was named sh (bourne shell) as was written by stephen bourne

112
Q

this is a set of standards and utilities maintained by IEEE that aims to maintain compatibility between operating systems. in turn meaning that an application can be run on either OS

The standards can define common APIs as well as how certain operating system tasks tasks should be handled.

Many OSs have some compliance with this

A

describe what

POSIX (Portable Operating System Interface)

is

113
Q

this is an accronym for

Portable Operating System Interface

A

what does

POSIX

stand for

114
Q

what is the outcome of typing

Cd ..

into a linux terminal

A

in a linux terminal:

this will take you back to the parent directory

115
Q
A

give a description of the linux

touch

command

116
Q

This linux command allows a single command to be executed with root privileges

A

describe the linux

sudo

command

117
Q

in a linux terminal:

this prints the current working directory

A

what is the outcme of typing

pwd

into a linux terminal

118
Q

what makes pipelining between commands possible

A

this is made possible because most commands will use text as thier input and output.

this means that commands can be used flexibly with each other since they are all using text format

119
Q

this can be called by scripts on linux but is not strictly available on linux.

instead it is available to call but is symbolically linked to the dash shell

A

does the sh shell exist on linux

120
Q

this linux shell:

  • is compatible with bash but offers more customisation
  • macOS has recently replaced bash with this shell
A

give 2 points about the linux:

Zsh (z shell)

121
Q

give a description of the linux

file

command and how it works

A

this will determine the type of a file

it works by performing three test on the file to determine its type / content. The first test to complete successfully is output in the terminal

122
Q

give three points about the linux:

Bash (bourne again shell)

A

this linux shell

  • is a widely used shell in linux distributions
  • maintains compatibility with the original sh shell
  • maintains compatibility with the original sh shell
123
Q

what does

dash

stand for

A

this is an accronym for

debian almquist shell

124
Q

this will determine the type of a file

it works by performing three test on the file to determine its type / content. The first test to complete successfully is output in the terminal

A

give a description of the linux

file

command and how it works

125
Q

what is the outcome of typing

Ls -a

into a linux terminal

A

in a linux terminal:

this will display all directories including any hidden ones

126
Q

this is an accronym for

debian almquist shell

A

what does

dash

stand for

127
Q

in a windows or linux terminal what does the (

A

this can be used to give STDIN (standard input) to a command from a file for example

128
Q

in a linux terminal:

this will take you back to the parent directory

A

what is the outcome of typing

Cd ..

into a linux terminal

129
Q

this will switch the shell to the root account and give the user full control of the system.

root can be omitted since linux will assume root

A

what is the outcome of typing

Sudo su root

into a linux terminal

130
Q

in a linux terminal:

this will display all directories including any hidden ones

A

what is the outcome of typing

Ls -a

into a linux terminal

131
Q

know as the pipeline. this allows you to redirect or ‘pipe’ the STDOUT (standard output stream) of one command to the STDIN (standard input stream) of another command

A

in a linux or windows terminal what is the ( | ) used for

132
Q

describe the linux

sudo

command

A

This linux command allows a single command to be executed with root privileges

133
Q

this can be achieved by entering

cat /etc/shells

A

how can we quickly view the available shells on a linux system via the terminal

134
Q

what is the outcome of typing

Date > filename

into a linux terminal

A

in a linux terminal:

this will redirect the output from the date command into the given filename, creating a new file if it does not exist

135
Q

what are the 2

hidden directories that every linux directory will have

A

these are:

. - this points to the directory itself

.. - this points to the parent directory

136
Q

what is the outcome of typing

Rmdir directory

into a linux terminal

A

in a linux terminal:

this will remove the given directory but only ever if it is empty

137
Q

this linux shell:

  • is an extremely lightweight shell
  • maintains compatibility strictly with the sh shell (can be used in place of the sh shell. this maintains compatibility with older scripts that may call sh)
A

give 2 points about the linux

Dash (debian almquist shell)

138
Q

in a linux terminal:

this will concatenate each of the files given and then redirect the output to the file given

A

what is the outcome of typing

Cat file1 file2 file3 > file4

into a linux terminal