There is a compulsory test on UNIX commands in CSC2001F. If you don't get 80% (this was the case in my year), you don't get DP and therefore fail the course. This summary covers all the possible commands you could be asked, and will help you get that DP effortlessly.
• Directory = file
o a file which consists solely of a set of other files
• While typing a file, press Tab for it to finish automatically
• ls (or l) = gives the list of all files in the directory you are currently in
• ls -l = the same as above but more detailed
• mkdir = makes a new directory
• cd = change directory (go into that directory)
• mv ??1 ??2 = changes the name of ??1 into ??2
• mv ??1 ~/??2/ = moves ??1 into the ??2 directory (/ = directory)
• Ctrl-k-x = saves the java file (or probably any file)
• more ??.java = prints the code out to the screen
• javac ??.java = compiles java program
• java ?? = Runs java program (leave out .java)
• joe Makefile = creates a new Makefile
• make = compiles the updated version of the file you file you changed (either it
will say it is up to date or it will say eg. “javac ??.java” which means it was
compiled/updated
• In a Makefile, you can create a rule to delete all .class files, which are the
compiled files. This way, you can only leave the source files
o clean:
rm. *.class [remove all class files]
• more Makefile = see what’s in the Makefile
• less ?? = does the same task as more but better
• Source directory (.java) vs bin directory (.class)
• joe ?? = opens up file
• In the Makefile if I say:
o run:
????
, o It means that I can now say make run and it runs the line of ??? code
automatically like auto replacement
• rm ?? = remove/delete file
• rm -r dirname/ = remove a directory
• rmdir ?? = remove/delete directory
• rm -r .git/ = remove git repository with everything inside
• git add name.java = adding .java to a git
• git commit -m 'message' = committing 2 files to be part of repository
• ??~ = backup file
• cd = go to home directory
• joe ??1/??2 = open a file that is in another directory within the directory you
are in
• cp = used to create a copy ie. cp HelloWorld.java HelloWorld_Copy.java
• cd .. = goes back to the previous/bigger/parent directory
• Ctrl-Shift-- = undo
• Ctrl-Shift-^ = redo
• Ctrl-Shift-+ = zoom in
• Ctrl-- = zoom out
• cd ../?? = move out of current directory into another director in its parent’s
directory
• q = while using the “more” command on a large file and you want to exit early
• java ?? > ??.txt = output redirection into new txt file
• java ?? >> ??.txt = output redirection into existing txt file
• rm *.txt (or any file extension) = removes all existing files with that extension
in that directory
• python ??.py = run python file from joe
• tar -zcvf myfolder.tar.gz myfolder = gzip.tar a whole Assignment
• tar -cf HelloWorld.tar HelloWorld = gathering files into single archive file
• gzip HelloWorld.tar = compresses a file
• tar -cf - Assignment 1 | gzip > assignment.tar = does above 2 in one go
• gzip -cd test.tgz = unzips and untars test.tgz
• tar -xf ??.tar.gz = unzip a tar.gz file
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller chloewalt. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R150,00. You're not tied to anything after your purchase.