Session 2
Thursday 30 December 2021 05:04
Work on the Command Line Environment variables - Physical place in memory that stores a value. Value is then available for a script
or programme.
Shell can also be known as CUI (Chewy) Contains information they need programmes do not know about when they are installed
Common shells: 'env' shows current environment variables. E.g. Current user, default shell etc
- Bash (most common)
- Sh or bsh (Bourne Shell) Access contents of env variables with echo command
- Csh (C shell)
- Ksh (Korn shell) Echo $HOME shows value stored in variable
- Zsh (Z Shell)
MYVAR=123 to set variable
Exam focuses on bash
'unset MYVAR' to remove variable
$ = Regular user
# = Super user Its tradition for environment variables to be names ALL CAPS
__________________________________________________________________________________
Some commands are stored in a file,
some commands are built into the shell Shell Config
'pwd' (print working directory) shows current directory Set command sets specific options/parameters for the shell
'ls -l' shows files and extensions. Blue files are directorys To make environment variables available anywhere in your session using the export command 'export
MYDOCS'. Makes variable available to all commands in your shell
'ls -al' shows all files including hidden files. Files that begin with full stop are hidden files _____________________________________________________________________________________
'.' refers to current directory Variable Assignments
'..' refers to parent directory
'gedit .bashrc', add into bottom line.
Root is only directory with no parent
_____________________________________________________________________________________
'll' is an extra command with the same function as 'ls-al' Other useful commands
'time' command. 'time gedit' displays time information on specified program
~/.bash_history shows historical commands used. Ctrl+P for previous, Control+N for next.
Ctrl+x & ctrl+e opens command in text editor (nano, linux default)
'man' = manual pages
'man ls' = manual page for ls command
'info ls' = description and more details for ls command
'uname -a' shows system information
'echo $PATH' is a list of directories that a shell uses to find executable programmes
'which ls' shows location of ls command
Linux Fundamentals Page 1
,Streams, Pipes and Redirects
Wednesday 5 January 2022 07:58
Input Stream - Where the information comes from Stdin = standard input (keyboard usually)
Stdout = standard output (represents monitor or terminal)
Output Stream - Where the information goes to Stderr = standard error
Linux Fundamentals Page 2
,Redirection operator
Wednesday 5 January 2022 08:04
Replaces output e.g. Ls > ls.txt outputs to a txt file rather than ls in terminal
Linux Fundamentals Page 3
, Pipe Commands
Wednesday 5 January 2022 08:10
Piping - connects the standard out of one command to the standard in of another command
Linux Fundamentals Page 4
Thursday 30 December 2021 05:04
Work on the Command Line Environment variables - Physical place in memory that stores a value. Value is then available for a script
or programme.
Shell can also be known as CUI (Chewy) Contains information they need programmes do not know about when they are installed
Common shells: 'env' shows current environment variables. E.g. Current user, default shell etc
- Bash (most common)
- Sh or bsh (Bourne Shell) Access contents of env variables with echo command
- Csh (C shell)
- Ksh (Korn shell) Echo $HOME shows value stored in variable
- Zsh (Z Shell)
MYVAR=123 to set variable
Exam focuses on bash
'unset MYVAR' to remove variable
$ = Regular user
# = Super user Its tradition for environment variables to be names ALL CAPS
__________________________________________________________________________________
Some commands are stored in a file,
some commands are built into the shell Shell Config
'pwd' (print working directory) shows current directory Set command sets specific options/parameters for the shell
'ls -l' shows files and extensions. Blue files are directorys To make environment variables available anywhere in your session using the export command 'export
MYDOCS'. Makes variable available to all commands in your shell
'ls -al' shows all files including hidden files. Files that begin with full stop are hidden files _____________________________________________________________________________________
'.' refers to current directory Variable Assignments
'..' refers to parent directory
'gedit .bashrc', add into bottom line.
Root is only directory with no parent
_____________________________________________________________________________________
'll' is an extra command with the same function as 'ls-al' Other useful commands
'time' command. 'time gedit' displays time information on specified program
~/.bash_history shows historical commands used. Ctrl+P for previous, Control+N for next.
Ctrl+x & ctrl+e opens command in text editor (nano, linux default)
'man' = manual pages
'man ls' = manual page for ls command
'info ls' = description and more details for ls command
'uname -a' shows system information
'echo $PATH' is a list of directories that a shell uses to find executable programmes
'which ls' shows location of ls command
Linux Fundamentals Page 1
,Streams, Pipes and Redirects
Wednesday 5 January 2022 07:58
Input Stream - Where the information comes from Stdin = standard input (keyboard usually)
Stdout = standard output (represents monitor or terminal)
Output Stream - Where the information goes to Stderr = standard error
Linux Fundamentals Page 2
,Redirection operator
Wednesday 5 January 2022 08:04
Replaces output e.g. Ls > ls.txt outputs to a txt file rather than ls in terminal
Linux Fundamentals Page 3
, Pipe Commands
Wednesday 5 January 2022 08:10
Piping - connects the standard out of one command to the standard in of another command
Linux Fundamentals Page 4