Log into your account on our Fedora Linux server
storm.cis.fordham.edu
and practice the
Linux commands.
Practice using the
vi
editor by hacking up the big file
xanadu.txt.
Go to your home directory with the
cd
command, and run the
pwd
program to make sure you arived there.
Put a little C++ program (in a file whose name ends with
uppercase
.C)
into your home directory.
You can write a brand new C++ program using
vi
(begin with the lowercase
i
command to insert text into the upper left corner of the brand new empty file.
Then press the
ESCape
key when you’re done making your initial insertion).
Or you can download one of my C++ programs
(e.g.,
boilerplate.C)
with the
wget
command
and then modify it with
vi.
Name your program anything you with want
(but just one word, and the name must
end with uppercase
.C;
remember that you know how to rename a file with the
mv
command.
In the following instructions, the dummy name
myprog.C
stands for whatever name you choose to give your program,
and the dummy name
myprog.txt
stands for whatever name you choose to give your file of output from
the program.)
Then compile your C++ program:
c++ myprog.C (This should create a new file named a.out) ls -l a.out (Space minus lowercase L: make sure you now have a file named a.out)Then run your C++ program twice:
./a.out (Send the program’s output onto the screen and look at it) echo $? (If you’re interested, you can see what the program’s exit status number was; should be zero)
./a.out > myprog.txt (Send the program’s output into a brand new file named myprog.txt) echo $? (If you’re interested, you can see what the program’s exit status number was; should be zero) ls -l myprog.txt (Make sure you now have a file named myprog.txt) cat myprog.txt (See what you put into the file myprog.txt)Then move (or copy) the C++ program and its output into the
public_html
subdirectory of your home directory:
mv myprog.C public_html mv myprog.txt public_htmlThen go down to your
public_html
subdirectory and make sure the two files
myprog.C
and
myprog.txt
actually arrived there:
cd public_html pwd (Make sure you arrived down in public_html) ls -l (List all the files there)Then point any browser at yourself in students and make sure you can see your two files. Or simply point any browser at these links:
https://storm.cis.fordham.edu/~jsmith/myprog.C
https://storm.cis.fordham.edu/~jsmith/myprog.txt
jsmith
is your Fordham ID.
in front of it.
(In a web link,
~jsmith
with a tilde
~
means the
public_html
subdirectory below the home directory of
jsmith.)
For your own edification, make a few programs with variables of different
data types.
For example, could you make a variable of type
double,
and put a value into it that contains several digits to the right
and left of the decimal point?
Could you then output the value of the variable rounded to
two digits to the right of the decimal point?
That’s what you’d want to do if the variable contained
a number of United States dollars.
See who has
logged in
to our Fedora Linux server
storm.cis.fordham.edu
since our last lecture ended at 10:00 pm EDT on Thursday, September 3, 2026.
Remember, we’re an elite group:
there are only
27 of us
left.