0% found this document useful (0 votes)
47 views8 pages

Lesson 1 Bad Bash

Uploaded by

Murilo Zanardo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

Lesson 1 Bad Bash

Uploaded by

Murilo Zanardo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

What is Bash?

Lesson 1 bash explained


bash
bash, an abbreviation of Bourne Again Shell, is the most common interactive interpreter
command prompt and has a long history. First, in 1971, Unix Shell or Thompson Shell had been
burned. Unix Shell was very small and had some small features. In 1975, it had been replaced by
Mashey Shell, and again this version had been replaced by Bourne Shell, which we have already
used.
In 1989, bash as an open-source project had been developed by Brain Fox. Brain Fox maintained
and supported bash till 1994 and Chet Romey was in charge of it. Today, bash is the default shell
script of Linux and MacOS10, which makes the use of bash very common.
At the time of writing this paper, the last version of bash is 5.1. Other operating systems may use
other releases. For more information about this project, have a look at Chet Ramey’s website:
Lesson1 cont.
 Bash is not the windows terminal.
 Linux allows bash one-liners and scripts. (demo)
 Bash is how you will interact with most information from tools.
 Bash has the ability to be very versatile.
 Bash is a great way to automate tools you already use.
 Bash mas lots of great commands. Resource: (
https://hakin9.org/bash-introduction-for-hackers-part-1/ )
Lesson 1 part 2 commands
 “Man” This command will show you the documentation for any command after it.
Use “man ls”
 “Ls” this command lists the contents of any directory.
Use “ls /home/user/”
 “Touch” this command is used to make a file but not open it.
Use “touch list.txt”
 “Grep” this command filters results of a file. Use “cat fastfood.txt |grep pizzahut”
Lesson 1 part 2 cont.
 “Cat” outputs the contents of a file to the terminal. Use “cat fastfood.txt”
 “|” pipe operator it sends the output of the first command into the input of the next.
Use “cat subs.txt | httprobe”
 “&” runs the command after it without checking if the command before it
completed. Use “cat live.txt >> urls.txt & cat urls.txt”
 “&&” executes the following command ONLY if the command before it completed
with no errors. Use “sudo apt update && sudo apt upgrade”
Lesson1 part 2 cont.
 “>>” this operator creates/”appends to” a file of the given name and write the
output of the previous command into it. Use “cat notes.txt >> newnotes.txt”
 “>” this operator outputs to a file and will overwrite it instead of appending the
information to the end of it. Use “cat notes.txt > notes.txt”
 “mv” moves a file to a given location. This is also the best way to rename a file in
terminal. Use “mv crankyfile.file /home/user/files/newnoncrankyfile.file”
 “cp” copy file to given location same use as mv.
Lesson 1 part 2 cont.
 “sudo” run command as root. Use “sudo cp file.file ./file.file”
 “cut” this is a filter command and will cut information out with a given delimitor.
Use “cut –d “ “ –f 1”
 “cd” this is a command used to change directories. Use “cd /home/user”
 “sed” used to replace content in a file with content you want for example if a file
had the work full in it and you didn’t want to have to go through the whole file and
change every full you would just do this. “sed ‘s/notfull/full/' file.txt”
Lesson 1 part 2 cont.
 “awk” awk is a programming language that runs inside of bash and most linux
distros its amazing to learn and we will dig into it throughout this session. Use
“awk 'program' input-file...”
 In the next lesson I will break all of these commands down and show you all of the
cool things you can do with them.

You might also like