Terminal is in Linux/Mac, it is a Command Line Interface. It’s kind of like Windows command prompt but more powerful. It gives you powerful control over the computer to access files, run all sorts of commands and more. You can write scripts in here, edit any of your computers files, or view processes of the ..
What’s In Your Environment (env, echo, Env:) Do This $ env TERM_PROGRAM=Apple_Terminal TERM=xterm SHELL=/bin/bash OLDPWD=/Users/zed/temp USER=zed COMMAND_MODE=unix2003 PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin PWD=/Users/zed/ LANG=en_US.UTF-8 PS1=$ SHLVL=1 HOME=/Users/zed LOGNAME=zed _=/usr/bin/env $ env | grep zed OLDPWD=/Users/zed//temp USER=zed PWD=/Users/zed/ HOME=/Users/zed LOGNAME=zed $ echo $USER zed $ echo $PWD /Users/zed/ $ export TESTING=”1 2 3″ $ echo $TESTING 1 2 3 $ ..
Do This $ man find $ man less $ man man $ man grep $ > help dir > help select-string > help help > help cp > You Learned This You can use the man command on Unix, and the help command in Windows to find information about commands. I’ve been playing a very ..
Do This I’m showing you a little trick for typing text into a file very quickly. If you do cat > somefile.txt then cat will read whatever you type and then write it to that file. On Windows it’s done with echo > somefile.txt. The important thing, though, is that you have to “close” the ..
Do This This exercise is going to combine three concepts into one single command. I’m going to show you how to find all your text files and page through them. $ cd temp $ find . -name “*.txt” -print $ cd .. $ find . -name “*.txt” -print | less $ cd .. $ find ..
Do This $ cd temp $ ls *.txt ex12.txt ex13.txt ex14.txt uncool.txt $ ls ex*.* ex12.txt ex13.txt ex14.txt $ ls e* ex12.txt ex13.txt ex14.txt $ ls *t ex12.txt ex13.txt ex14.txt uncool.txt $ cat *.txt > bigfile.txt $ rm *.txt $ ls $ > cd temp > ls *.txt Directory: C:\Users\zed\temp Mode LastWriteTime Length Name —- ..
Do This $ cat ex12.txt ex13.txt | less $ cat < ex13.txt I am a fun guy. Don’t you know why? Because I make poems, that make babies cry. $ less < ex12.txt $ less < ex12.txt | cat | less $ cat ex13.txt > ex15.txt $ cat ex15.txt I am a fun guy. Don’t ..
Do This $ cd temp $ ls uncool.txt iamcool.txt neat.txt something thefourthfile.txt $ rm uncool.txt $ ls iamcool.txt neat.txt something thefourthfile.txt $ rm iamcool.txt neat.txt thefourthfile.txt $ ls something $ cp -r something newplace $ $ rm something/awesome.txt $ rmdir something $ rm -rf newplace $ ls $ > cd temp > ls Directory: C:\Users\zed\temp ..
Stream A File (cat) You’re going to do some more setup for this one so you get used to making files in one program and then accessing them from the command line. With the same text editor from Exercise 12, create another file named ex13.txt but this time save it directly to your temp directory. ..
View A File (less, MORE) To do this exercise you’re going to do some work using the commands you know so far. You’ll also need a text editor that can make plain text (.txt) files. Here’s what you do: Open your text editor and type some stuff into a new file. On OSX this could ..