diff --git a/docs/Linux/shellbasics.md b/docs/Linux/shellbasics.md index 81e0f45..52cabdd 100644 --- a/docs/Linux/shellbasics.md +++ b/docs/Linux/shellbasics.md @@ -1,6 +1,6 @@ # Basics -Basics of how the linux shell can be used to interact with programs +Basics of how the linux shell can be used to interact with applications ## Streams @@ -10,40 +10,40 @@ The main three streams that are used on the command line are STDIN (Standard inp ```bash STREAM ID STREAM NAME STREAM USE -0 STDIN Used to send input to the program -1 STDOUT Used to receive output from the program -2 STDERR Used to receive errors from the program +0 STDIN Used to send input to the application +1 STDOUT Used to receive output from the application +2 STDERR Used to receive errors from the application ``` ### Standard Input -Standard input is how we send input to an program it is also how we interact with the command line shell (Usually [`bash`](/Linux/bash.md)) +Standard input is how we send input to an application it is also how we interact with the command line shell (Usually [`bash`](/Linux/bash.md)) -Whenever a linux program asks for input this is sent to the program using the STDIN stream +Whenever a linux application asks for input this is sent to the application using the STDIN stream -The STDIN stream can also be refrenced by the '-' char in a command line program `cat -` will print what comes into STDIN (The terminal) +The STDIN stream can also be refrenced by the '-' char in a command line application `cat -` will print what comes into STDIN (The terminal) -One thing that makes the linux command line so powerfull is the suite of commands that is provided all work using STDIN, STDOUT and STDERR you can pipe information from one stream to another (i.e the STDOUT from one program can be in STDIN to another) +One thing that makes the linux command line so powerfull is the suite of commands that is provided all work using STDIN, STDOUT and STDERR you can pipe information from one stream to another (i.e the STDOUT from one application can be in STDIN to another) #### Input Redirection -You can use redirection to send information to a program using the '<' symbol i.e `cat < file` this will push the contents of 'file' to cat using STDIN +You can use redirection to send information to a application using the '<' symbol i.e `cat < file` this will push the contents of 'file' to cat using STDIN ### Standard Output -Standard output is how we get the output from a program, usually this is printed directly to the terminal +Standard output is how we get the output from a application, usually this is printed directly to the terminal #### Output Redirection -You can redirect the STDOUT of a program is a few ways you can use the '>' symbol to push the information from the programs output and saves it in a file for example `ls > filelist` will take the output of ls and saves it in the filelist file +You can redirect the STDOUT of a application is a few ways you can use the '>' symbol to push the information from the applications output and saves it in a file for example `ls > filelist` will take the output of ls and saves it in the filelist file -You can also redirect the STDOUT of one program to another programs STDIN using the '|' symbol, this is called a pipe doing this you can combine muliple programs in different ways +You can also redirect the STDOUT of one application to another applications STDIN using the '|' symbol, this is called a pipe doing this you can combine muliple applications in different ways For example you can use `ls -alh | grep filename` this will list the files in the current directory and then passes the STDOUT to the STDIN for grep, this causes grep to use the output of ls as the input data to work with so the output of ls is searched for the string 'filename' ### Standard Error -Standard error is how error messages are sent between programs or displayed to the user +Standard error is how error messages are sent between applications or displayed to the user As this is a different to STDOUT you will still get output to the terminal if you redirect using the '>' symbol @@ -51,8 +51,8 @@ As this is a different to STDOUT you will still get output to the terminal if yo Errors can be redirected using the following '2>' this specifies the stream to redirect and the direction -For example you can redirect errors of an program to an error log file using '2> error.log' so a command that uses this would look like `find / -name "filename" 2> errors.log` this would make an error.log in the directory you are in and save the errors in a log and show the results from STDOUT on the screen (In this example the errors that you would see are `Permission Denied` errors) +For example you can redirect errors of an application to an error log file using '2> error.log' so a command that uses this would look like `find / -name "filename" 2> errors.log` this would make an error.log in the directory you are in and save the errors in a log and show the results from STDOUT on the screen (In this example the errors that you would see are `Permission Denied` errors) ### More redirection tips -You can do quite a bit with piping and redirection, using these basics you will be able to do quite a bit in the bash shell I have created some examples both to show how programs can work together and provide some real world examples on what it can be used for [here](/examples/redirection) +You can do quite a bit with piping and redirection, using these basics you will be able to do quite a bit in the bash shell I have created some examples both to show how applications can work together and provide some real world examples on what it can be used for [here](/examples/redirection) diff --git a/docs/Troubleshooting/checkinglogs.md b/docs/Troubleshooting/checkinglogs.md index faef9cd..df7fd4d 100644 --- a/docs/Troubleshooting/checkinglogs.md +++ b/docs/Troubleshooting/checkinglogs.md @@ -1,6 +1,6 @@ # Checking log files -The best way to see what a program is doing is to see what is in the logs for the particular program, by defaul logs are in the `/var/log` directory but they can also be in others as well +The best way to see what a application is doing is to see what is in the logs for the particular application, by defaul logs are in the `/var/log` directory but they can also be in others as well ## Common log locations @@ -15,7 +15,7 @@ The best way to see what a program is doing is to see what is in the logs for th ## Reading logs -You can read the log files using command line programs like `cat` and `less`, cat will just print the file to the terminal where less will open the file up in a [pager](/Commands/pagers), this allows for things like searching without closing the logs +You can read the log files using command line applications like `cat` and `less`, cat will just print the file to the terminal where less will open the file up in a [pager](/Commands/pagers), this allows for things like searching without closing the logs You can open a log with something like `less /var/log/mainlog` this will allow you to read over the log and search for the information that you wanted @@ -27,4 +27,4 @@ If you wanted to watch the logs live as you are testing something you can use th The Archived logs will usually be in a compressed gzip format with the date code and the .gz extenstion. -You can read these logs by either uncompressing them using `gzip -d` or you can use some handy versions of commands like `cat` and `grep` that are built to work with compression, these are `zcat` and `zgrep` \ No newline at end of file +You can read these logs by either uncompressing them using `gzip -d` or you can use some handy versions of commands like `cat` and `grep` that are built to work with compression, these are `zcat` and `zgrep`` \ No newline at end of file diff --git a/docs/examples/redirection.md b/docs/examples/redirection.md index a35d0fb..0b17c9a 100644 --- a/docs/examples/redirection.md +++ b/docs/examples/redirection.md @@ -4,7 +4,7 @@ This page has a few examples of some things that can be done using redirection a ## Pipes -Pipes are usefull when you need to do something with an programs output +Pipes are usefull when you need to do something with an applications output In the following command output we may be looking for a file that is starting with 'pas'