You are on page 1of 7

Java

Tutotrial for [NLP-AI]


2

ashishfa@cse.iitb.ac.in

October 7, 2022 1
Assignment solution
 Try to print these two figures on the screen
using println and least number of strings

October 7, 2022 Java Tutorial series part 2 2


Essential Linux commands

 Use tukaram(10.144.22.105) or any other linux machine


 Type javac and java, to verify if java is installed and working properly.
 Login to tukaram
[ashish@tukaram lec2]$

 Create folder (directory)


mkdir <foldername>
 Goto that folder
cd <foldername>
cd
- To use or work into the folder
 Remove a folder
rmdir <foldername>
 list all file in the folder
ls

October 7, 2022 Java Tutorial series part 2 3


Vi (Vim)
 Vi is notepad of Linux.
 Used to write programs
 Works in 2 modes
 Command mode
- While in vi, press escape to go to command mode
 Edit mode
- while in vi, if you are in command mode, press ‘i’ on
keyboard once to go to edit mode .

October 7, 2022 Java Tutorial series part 2 4


Vi …
vi <filename>
 To create a new file or existing file.
e.g. vi int1.java
 Before start typing, press ‘i’ to goto edit mode and type
the program.
 To save program
Press escape and then these 2 characters “:w”
 To save and quit vi
Press escape and then these 3 characters “:wq”
 To quit vi without saving the latest changes
Press escape and then these 3 characters “:q!”

October 7, 2022 Java Tutorial series part 2 5


Essential Linux commands
rm <filename>
 This command deletes the file specified
e.g. rm int1.class

 To log out press ‘ctrl-D’ at command prompt

 javac , java

October 7, 2022 Java Tutorial series part 2 6


Thank you

October 7, 2022 Java Tutorial series part 2 7

You might also like