A DOSile EXPERIENCE
(contains no useful information)
I faintly remember using DOS on a pre-windows computer. When I was in 7th grade, before my dad had bought our first family computer. I was required to take computer class for three months. I would love to tell you that class was life-changing and sparked an interest in technology that burned inside of me from that day on...
But to me, at the age of 11, the thing that was most exciting about computers was their capacity to print large shitty address labels that sported shamefully pixelated images of Garfield And Friends. I was one of those kids who loved to stickers. My dresser, my homework folders, the brown paper bag covers on my books were all covered in stickers. So I'm pretty sure the day we learned how to make our own sticky labels was raddest day of my life.
As soon as I got home from school, I hand-wrote a half a dozen letters to send out to friends and family. Then I marched out to the mailbox, tipped up the red flag and gave the almost indistinguishable pictures of Odie and Garfield one last loving glance as I sent them off to "wow my friends and family."
... so I guess that's why seeing the good ol' black and white > on my screen makes me feel cool... or maybe its cool for the same reason overly-pixelated graphics of Garfield are cool. Terminal commands are the OGs of computer interfacing. But using the command prompt is more than just a kookie-retro thing, it can actually be quite handy.
**** useful stuff starts here****
WHAT IS THE COMMAND PROMPT/ TERMINAL?

-The command prompt (> on a windows computer or $ on a Mac) is a non-GUI (graphical user interface) way to can access files and programs without a mouse or touch screen).
WHY WOULD YOU USE THE COMMAND PROMPT/ TERMINAL?

-If you are familiar with searching/ accessing files through the command prompt it can be an extremely efficient and precise way to search and access files. (ie instead of opening finder and scanning through to the folder you want and then selecting the file you are looking for in that folder, you can just type one line into the command prompt and BAM, you've opened the file you were looking for. )
-It is the fastest easiest way to use certain Interfaces eg (Git Hub)
HOW DO YOU LEARN TO USE IT?
Here are a few sites that are helpful in getting started with using the terminal:
The Command Line Crash Course
LinuxCommand.org
Ryan's Linux Tutorial
WHAT ARE THE BASICS?
ls: lists the files in a directory
(adding -a will show files with any extension (some of which are normally hidden like git repository info)
cp: Copy the contents of a file and move it to a different file
eg:
cp file1.txt newBlankfile.txt OR file1.txt file2.txt
cp file1.txt newBlankfile.txt OR file1.txt file2.txt
mv: rename a file or directory OR move a file or directory
eg:
eg:
mv file1.txt improvedFile1.txt ... will rename "file1.txt": "improvedFile1.txt"
or
or
mv file1.txt folder1 ... will move file1.txt into folder1
or
or
mv folder1 theAwesomeFolder ... will rename the directory "folder1": "theAwesomeFolder"
mkdir: make a new empty directory (folder).
cd: change directory. Change from one directory to another
eg
eg
cd .. takes you one step backwards in your path
cd ~ takes you to your home directory
cd ../../.. takes you three back
cd ~/desktop/fileOnDesktop takes you from the home directory forward 2 steps from there
pwd: "print working directory" ie show the path to get to where you currently are
less: gives you a summary of what's in a file
syntax: less file-name
syntax: less file-name
http://www.thegeekstuff.com/2010/02/unix-less-command-10-tips-for-effective-navigation/
cat: Displays text file, file concatenation, create new text file, modify file, read text file
syntax: cat filename OR cat > filename OR cat [options] filename
man: displays a manual of linux commands
syntax: man [option(s)] keyword(s)
eg man ls OR man pstree | col -b pstree.txt
grep: seraches any given input file, selecting lines that match one or more pattern(s). By default, a pattern matches an input line if the regular expression (RE) in the pattern matches the input line. Each input line that matches at least one of hte patterns is written to the standard output.
syntax: grep patternYoureLookingFor filename
find: finds stuff
syntax: find location comparison-criteria search-term
syntax: find location comparison-criteria search-term
. finds all the files in the current and subdirectories
The pipe: method to send data from one program to another. Output is fed from the program on the left side of the "|: to the program on the right
syntax: fileOne and/or LinuxCommand1 | file2 and/or LinuxCommand2 | etc etc
eg
ps auxwww | grep fred | more
ls -al |grep Aug| grep -v '200[456]'| more
echo: appends text to a file.
syntax: echo "some text" >> afile.fileType (.txt, .rb etc)
touch: creates an empty file
syntax: touch newFileName.type
syntax: touch newFileName.type
No comments:
Post a Comment