Difference between revisions of "CS Server - Terminal"

From Computer Science
Jump to: navigation, search
(Opening a Terminal)
(Windows 10)
Line 8: Line 8:
 
Here we point you in the right direction to get a terminal program open, depending on what operating system you are using.
 
Here we point you in the right direction to get a terminal program open, depending on what operating system you are using.
  
==Windows 10==
+
==Windows==
 
* Click the start button.
 
* Click the start button.
 
* Start typing "Command Prompt". When the icon for the program comes up, click on it.
 
* Start typing "Command Prompt". When the icon for the program comes up, click on it.

Revision as of 11:39, 17 August 2022

If you have an account for the CS server and labs (see CS Accounts and CS Lab Computers), this page points you in the right direction for how to connect to the CS server with a terminal program.

Basically, you will open up a terminal program on your computer, and then use it to make the connection. A terminal program is a program where you type commands to the computer. Up until the 1980s, this is how most people interacted with computers, and this is still how programmers at times interact with computers.

Now, on to getting connected...

Opening a Terminal

Here we point you in the right direction to get a terminal program open, depending on what operating system you are using.

Windows

  • Click the start button.
  • Start typing "Command Prompt". When the icon for the program comes up, click on it.
  • You should see the "Command Prompt" start.

Some commands that you can type in the Windows command prompt include -

  • dir to list directory contents.
  • cd to change the directory that is being shown.
  • help to see a list of other commands.
  • ssh to connect to a remote server - see the next section below to connect to the CS server.

Mac OS

Linux

Chromebook

Connecting to the CS server

Once you have a terminal program open, you are ready to connect to the CS server. You will type the following and press enter:
ssh YOUR_LOGIN@cs.indstate.edu

If your login was cs15100, then you would type ssh cs15100@cs.indstate.edu and press enter.

Note that the above command is case-sensitive and must be exact. If you typed Ssh rather than ssh (or SSH, or sh, or sss, or ...) then it would not work. If you accidentally put an extra space somewhere (or leave one out), or skip one of the .'s, or ... then it won't work. So if you try it and it doesn't work, then carefully check what you typed against what is above.

If you typed it in correctly, then you will be prompted for your password. Type in your password, and keep typing it even if you don't see anything on the screen (it doesn't display anything as you type, as a security feature). When done typing your password, press enter. If you typed it in correctly, you will be logged in.

Example Commands

Here's hoping you made it through all of that. If so, you are ready to run commands on the CS server. Here's a sneak peak of what fun you can have. This is a printout of running some commands and what they might do. Note that the first part ("cs50000@cs:/u1/class/cs50000>") is called the "prompt" and was not typed by the user. The commands typed by the user were the part after that (the first command typed was date).

cs50000@cs:/u1/class/cs50000> date
Tue Aug 16 22:05:19 EDT 2022
cs50000@cs:/u1/class/cs50000> cal
     August 2022    
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31         
cs50000@cs:/u1/class/cs50000> hostname
cs.indstate.edu
cs50000@cs:/u1/class/cs50000> uptime
 22:04:18 up 293 days,  5:58,  4 users,  load average: 0.29, 0.20, 0.12
cs50000@cs:/u1/class/cs50000> free -h
               total        used        free      shared  buff/cache   available
Mem:           995Gi       4.4Gi       4.0Gi        35Mi       987Gi       981Gi
Swap:          4.0Gi       1.0Gi       3.0Gi
cs50000@cs:/u1/class/cs50000> ls
demo/  Desktop/  Documents/  Downloads/  Music/  Pictures/  Public/  Templates/  Videos/
cs50000@cs:/u1/class/cs50000> pwd
/u1/class/cs50000
cs50000@cs:/u1/class/cs50000> whoami
cs50000
cs50000@cs:/u1/class/cs50000> echo "hello world"
hello world