Terminal introduction workshop: Difference between revisions

From Hackers & Designers
No edit summary
No edit summary
Line 1: Line 1:
We will say something interesting about Terminal here.
Terminal is the Mac OS X command line app for controlling the system via a text based interface, instead of the traditional graphical interface.


Put a list of commands here.
Put a list of commands here.


[[man]]
== How Terminal works ==


Navigating the filesystem
[[File:Terminal2.png|thumb|alt=A graphical representation of the Terminal processes.|The standard streams for input, output, and error.]]
[[ls]] - "ls" command
In it's most simple terms, the Terminal operates on a series of ''Inputs'' and ''Outputs''. You '''input''' one command into the terminal, and it'll pass the data through the '''programmed function''' before '''outputting''' you the result.
[[cd]]


up arrows go through history
By stringing (aka. piping) commands together, you can take the results of an Output and manipulate it further before presenting the completed Output to the user.
tab auto-complet


* how to go to another folder
For example, a user could use [[banner]] to create an ASCII glyph, save it to a file and then [[lp]] (local print) to print a file. By stringing them together however, the user can take the direct result from the banner command and then send that directly on to the printer, without having to deal with the intermediate file manipulation.
* how to to back


Using the Terminal has many advantages over the typical desktop GUI (Graphical User Interface) you're likely accustomed to. Using command line can allow you to write scripts to automate tasks, combine and string simple commands together and manipulate file contents, all from within the Terminal.


== Terminal Workshop ==


Creating files/etc....
1.) Connect to the Correct Wifi (Hackers & Designers)
[[touch]]
[[cat]]
[[echo]]
[[wc]]
[[grep]]
[[find]]
[[rm]] . . . -rf [[sudo rm -rf /]]


2.) ssh pi@10.1.1.1


3.) sudo adduser [your name], add a password


4.) Add your first name, skip the rest (return key)


5.) exit


what is >
6.) ssh [your name]@10.1.1.1
what is >>
what is |


7.) whoami


8.) whoami >> /pub/dump


9.) who


Internet/network stuff
10.) talk [some other user]@10.1.1.1
[[ftp]]
[[ssh]]
[[curl]]


11.) figlet 'finntern' | mail -s 'special message for you!' finn


Terminal pipeline....to create a message that deletes itself.




echo "hello" > index.html
== List of ideas ==


say something localhost what is port 80
echo 'my big secret' > /dev/null


echo "hello" > hello.txt; cat hello.txt; rm hello.txt
dd if=/dev/zero of=/dev/hda bs=1M




sudo php -S localhost:80
 
 
 
 
== Terminal Basics==
 
''Main Aricle: [[Terminal Basics]]''
== List of Common Terminal commands and syntax ==
{| class="wikitable"
|-
! Input
! Command
|-
| ''Up Arrow Key''
| Cycle through command history.
|-
| ''Tab''
| Autocomplete command.
|-
| [[ls]]
| List all files in directory.
|-
| [[cd]]
| Change current directory.
|-
| [[pwd]]
| Print current directory.
|-
| [[rm]]
| Delete file or directory.
|-
| .
| Within current directory.
|-
| ..
| Up one directory.
|-
| [[touch]]
| Create empty file within current directory.
|-
| [[mkdir]]
| Create empty directory within current directory.
|-
| [[sudo]]
| Run command with super-user security privileges.
|-
| [[ls]]
| List all files in directory.
|-
| ls -a
| List all files in directory, including hidden files.
|-
| ls -l
| Long format listing.
|-
| ls -t
| List all files and directories by order of date modified.
|-
| [[rm]]
| Delete directory/ file.
|-
| rm -r
| Delete directory and all child directories/ files.
|-
| [[cp]]
| Copy files.
|-
| [[touch]]
| Create empty file within current directory.
|-
| [[pwd]]
| Print working directory.
|-
| [[mkdir]]
| Make directory.
|-
| [[cd]]
| Change directory.
|-
| [[mv]]
| Move/ Rename file.
|-
| [[cat]]
| Print current contents of file.
|-
| >
| Take output from one command and insert to other.
|-
| >>
| Append to file. ''Left to right''
|-
| |
| Pipe. Used to string commands together.
|-
| [[grep]]
| Global regular expression print.
|-
|}

Revision as of 17:44, 3 February 2016

Terminal is the Mac OS X command line app for controlling the system via a text based interface, instead of the traditional graphical interface.

Put a list of commands here.

How Terminal works

File:Terminal2.png
The standard streams for input, output, and error.

In it's most simple terms, the Terminal operates on a series of Inputs and Outputs. You input one command into the terminal, and it'll pass the data through the programmed function before outputting you the result.

By stringing (aka. piping) commands together, you can take the results of an Output and manipulate it further before presenting the completed Output to the user.

For example, a user could use banner to create an ASCII glyph, save it to a file and then lp (local print) to print a file. By stringing them together however, the user can take the direct result from the banner command and then send that directly on to the printer, without having to deal with the intermediate file manipulation.

Using the Terminal has many advantages over the typical desktop GUI (Graphical User Interface) you're likely accustomed to. Using command line can allow you to write scripts to automate tasks, combine and string simple commands together and manipulate file contents, all from within the Terminal.

Terminal Workshop

1.) Connect to the Correct Wifi (Hackers & Designers)

2.) ssh pi@10.1.1.1

3.) sudo adduser [your name], add a password

4.) Add your first name, skip the rest (return key)

5.) exit

6.) ssh [your name]@10.1.1.1

7.) whoami

8.) whoami >> /pub/dump

9.) who

10.) talk [some other user]@10.1.1.1

11.) figlet 'finntern' | mail -s 'special message for you!' finn


List of ideas

echo 'my big secret' > /dev/null

dd if=/dev/zero of=/dev/hda bs=1M




Terminal Basics

Main Aricle: Terminal Basics

List of Common Terminal commands and syntax

Input Command
Up Arrow Key Cycle through command history.
Tab Autocomplete command.
ls List all files in directory.
cd Change current directory.
pwd Print current directory.
rm Delete file or directory.
. Within current directory.
.. Up one directory.
touch Create empty file within current directory.
mkdir Create empty directory within current directory.
sudo Run command with super-user security privileges.
ls List all files in directory.
ls -a List all files in directory, including hidden files.
ls -l Long format listing.
ls -t List all files and directories by order of date modified.
rm Delete directory/ file.
rm -r Delete directory and all child directories/ files.
cp Copy files.
touch Create empty file within current directory.
pwd Print working directory.
mkdir Make directory.
cd Change directory.
mv Move/ Rename file.
cat Print current contents of file.
> Take output from one command and insert to other.
>> Append to file. Left to right
| Pipe. Used to string commands together.
grep Global regular expression print.