100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary All essential commands to help you ace the CSC2001F unix test

Rating
-
Sold
-
Pages
5
Uploaded on
24-01-2022
Written in
2021/2022

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.

Show more Read less
Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
January 24, 2022
Number of pages
5
Written in
2021/2022
Type
Summary

Subjects

Content preview

Command Lines for Terminal in Ubuntu

• 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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
chloewalt University of Cape Town
Follow You need to be logged in order to follow users or courses
Sold
24
Member since
3 year
Number of followers
12
Documents
36
Last sold
2 weeks ago

4.8

6 reviews

5
5
4
1
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions