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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller oisinkmcn. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $8.02. You're not tied to anything after your purchase.