Getting Started with Terminal

  Terminal  
 Jan 2015

<3 Your Terminal

Is terminal in your Doc? do you use it? If not you are missing out as a web professional. Learning a few commands, or at least being aware of what to look up, makes you more productive and confident on your own (Linux or OSX) machine and when working on a server.

Navigating

# get usernamewhoami
obiwan
#find out where you arepwd
/Users/obiwan/test
# what is in this dir?ls
# bit more detail about permissions, filesizes etc...ls -l
drwxr-xr-x  3 obiwan  staff  102 27 Nov 15:51 andy
-rw-r--r--  1 obiwan  staff  812 27 Nov 15:56 andy.zip
# whats in here?
❯ tree
.
├── obiwan
│   └── bob
│       ├── somefile.txt
│       ├── test.txt
│       └── text.txt
└── text.txt
# move aboutcd SomeFolder
#up one levelcd ..
#twocd ../..
#put it together...cd ../../images/somthing  

Working with Files and Archives

# make a Foldermkdir SomeFolder
# make a filetouch somefile.txt
# put text into a fileecho "some output" > somefile.txt
# read a text file contentscat somefile.txt
# copy a file or dircp SomeFile destinationDir
# move a file or dirmv SomeFile destinationDir
# delete a filerm SomeFile
# Delete a folder and everything in itrm -r SomeFolder
# archive the obiwan folder
❯ zip -r obiwan.zip obiwan
# and unzip it
❯ unzip obiwan.zip

That’s it for now. Next up, Git, Searching, SSH & SFTP. Scary? Not really and once you have the hang of it you won’t look back.


Web Development

Got a web project you need doing well? We can help with that!

Find out more