Linux and CS Systems - Getting Started and Linux - System Setup: Difference between pages

From Computer Science at Indiana State University
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
This page is meant to help a new student in a CS course at ISU to get familiar with using Linux (in particular using the text-based terminal to interact with the system).
This page is meant to help you get your computer ready to connect to the CS server.


=Getting Started=
''Note - this page needs updating, was last updated in 2020.''
# '''Read''' - [https://ubuntu.com/tutorials/command-line-for-beginners#1-overview Ubuntu Linux Command Line Tutorial] or [http://www.ee.surrey.ac.uk/Teaching/Unix/ Linux Tutorial] - this gives you some background and introduces you to some of the terms that we use.  After reading through the tutorial you have a better chance of being able to follow along the rest of the steps in this Getting Started.
# '''System Setup''' - [[Linux - System Setup]] - to get your computer setup (programs installed, etc.).
# '''Using the Terminal'''
## [[Linux Terminal - Files and Directories and Getting Around]]
## [[Linux Terminal - System Information]]
## [[Linux Terminal - Text Editors]]
## [[Using Linux - Large Text Files]]
## [[Linux Terminal - More Commands to Know]]


=Common Mistakes=
=CS User Accounts=
* When logging in remotely to the CS server, when you are typing your password you might not see anything printed on your screen while you typeThat is a security feature so that someone watching your screen would not know how many characters are in your password.  Just finish typing your password and type enter when finished.
Below we guide you through getting software setup on your computerIn order to connect to the CS server you will also need your CS user account; see [[CS accounts]].  
* Note that all commands and file names in Linux are '''case sensitive'''.  hello.txt is different than Hello.txt.  The copy command is cp, Cp would not work, and neither would cP or CP.
* The characters _ and - are different, and having a space in a file name is different than not having one ("hello world.txt" is different than "helloworld.txt").
* For Linux directories and filenames, the "/" character is used to separate directories.  On Windows, the "\" character is used instead.  If you typed <pre>cd /home/cs151</pre> then this changes the directory to the cs151 user's home directory.  If you instead typed <pre>cd \home\cs151</pre> you would get an error.
* The "top" or "highest level" of the Linux file system is the directory / and this is comparable to the "C:\" that was traditionally the top of the file system in Windows.  In Windows there can be multiple drives (so D:\, E:\, etc.), but in Linux '''everything''' is underneath / (including additional drives, they will show up at a certain location under /).
* On Linux, ~ is a shortcut for your home directory.  User jkinne@isuad.indstate.edu's home directory is in /home/jkinne@isuad.indstate.edu, so if this user is logged in and types <pre>cd ~</pre> then this means to change directories to /home/jkinne@isuad.indstate.edu/.  If user jeff types <pre>cd ~</pre> then this means to change directories to jeff's home directory (which happens to be /home/jeff/).
* Not all sequences of commands are ''idempotent'' - this is a technical term that means that the sequence of commands gives the same results if executed more than once. For example, executing <code>echo "hello world!" >> hello.txt</code> once creates a file hello.txt that has one line in it, but executing again makes the file have two lines. When you see a sequence of commands to run to complete some task (e.g., from an online tutorial) be careful to execute one command after the other, all the way through, stopping after each to make sure you know what that step was supposed to do.
* Sometimes the precise syntax of commands might depend on which shell program you are using. bash is the default shell program on the CS server, but  zsh is commonly used instead.  You can see which shell you are running by executing the <code>ps</code> command and seeing which one is in the printed output from that command.  For example, the command for displaying your resource limits is <code>ulimit -a</code> in bash and zsh, but is <code>limit</code> in tcsh. When looking up how to do things online, it is good to include your shell in the search terms (e.g., search for - bash get resource limits - rather than just - get resource limits).


=More Reading=
=Your Personal Computer=
Read through another tutorial about Linux.  Some options include the follow.
You need to have access to a computer that you can install the following on - (a) ''terminal program'' used to connect to the CS server and execute commands on the CS server, (b) ''file transfer program'' for transferring files between your computer and the CS server, (c) ''text editor'' to use on your computer.
* [http://www.linuxcommand.org/ Linux Console Tutorial]
* [http://www.reallylinux.com/ Information for Beginning Linux Users]
* [http://cs.indstate.edu/~sbaker/faq/QuickRefCard.pdf Unix/Linux Quick Reference Card]


=Self Test=
'''The minimum to get you started is to get a terminal program working.'''  You can use the terminal program to connect to the CS server and do your work in the terminal. Eventually you will want to get setup with a file transfer program and text editor on your personal computer, but you can get started just with a terminal.
Note: a practice quiz over linux commands and the terminal is here - https://indstate.instructure.com/courses/12565/quizzes/244584


Here we give small tasks for you to complete.  These are numbered so that we can refer to them.  For each you would need to be logged into one of the CS systems (remotely logged into the CS server or using one of the CS lab computers).
==Terminal Program==
A terminal program allows you to type commands to run programs and view files and folders on your computer, and allows you to do the same on a remote computer (i.e., the CS server) after you have connected to it.


''Linux.1'' Log in to the CS server, create a directory named aboutMe in your home directory, and create a text file name.txtIn the name.txt file, give your full name.
If you are using MacOS, Linux, or an up to date Windows system then you already have a terminal program installed. You don't need to install anything, you just need to follow some steps to use the terminal program that is already installed.   


''Linux.2'' In your aboutMe directory, create a file courses.txt and list which CS courses you are currently taking or plan to take in the upcoming term.
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect.  Type or click yes.''


''Linux.3'' Log in to the CS server, create a directory named notes in your home directory, and create a text file named linux.txt and put in some links to linux tutorials or information that you have found helpful.
* '''On Windows''' - you have two options - use the built-in ssh client if your Windows computer is up to date, or install a terminal program. [https://youtu.be/kqkgXhKjAP8 video demo of both options from around 2020]
** ''Built-in ssh'' - Click the start button, type cmd, click Command Prompt to open the command prompt program, then in this window type "ssh username@cs.indstate.edu" and then enter (but with your CS username) to start your connection to the CS server.  Note that you need an up to date Windows 10 for the ssh program to be pre-installed.
** ''Putty'' -  [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html download] [http://cs.indstate.edu/FAQ/PuTTY/ Installing Putty on Windows].  Putty has some features that the built-in ssh client does not; either are sufficient to get started.
* '''On Mac OS''' - ''Built-in Terminal'' - [https://youtu.be/xtDFNGe6Gy4 video demo] Use the built-in Terminal program in Mac OS to connect to the cs server, and you can also use the Terminal program to run commands on your local computer. You open the terminal by opening Finder, then click on Applications, then click on Utilities, then open Terminal.  When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).
* '''On Chromebook''' - Install the ''Secure Shell'' app - [https://youtu.be/IjNdGu36bok video demo], [https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo?hl=en Download] [https://chrome.google.com/webstore/detail/secure-shell-extension/iodihamcpbpeioajjeobimgagajmlibd Chrome Extension] [https://mooselander.com/secure-shell-app-setup-and-profiles/ configuration]
* '''On Linux''' - ''Built-in Terminal'' - Similar to MacOS, a terminal program is already built-in.  How to get to the terminal program (also called the "shell") depends on which distribution you are running - ask the internet where to find the terminal program for your distribution.  When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).


''Linux.4'' Log in to the CS server, create a directory named linux-bootcamp in your home directory.
==File Transfer Program==
You will eventually need to transfer files between your personal computer and the CS server.  Most OSes have built-in support to do this, but there are other options that are easier to use.  We recommend choosing a file transfer program to install.  For Windows or Mac you will download the installer to install the program.  If you are using Linux or Chromebook, see the sections below about these environments.
* [https://cyberduck.io/download/ CyberDuck] - works for MacOS or Windows, is freeware, click the large "Download for Windows" or "Download for macOS" in the middle of the page.
* [https://winscp.net/eng/download.php WinSCP] - works for Windows, scroll past ads and click the "Download WINSCP" button.
* [https://www.gftp.org/ gFTP] - good option for Linux, see below about Linux for how to install.


''Linux.5'' In your linux-bootcamp directory, create a text file shake.txt. In shake.txt, put how many lines are in the shakespeare.txt file mentioned in the information above.
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect. Type or click yes.''


''Linux.6'' In your shake.txt file, add information about how many times "the" appears in shakespeare.txt.  Use the command grep,
''Note - make sure to choose "sftp" as opposed to "ftp" when connectingftp is not encrypted and is disabled on the CS server (it will not work)sftp is encrypted and is what we use.''
add to what you had how many lines "the" appears in shakespeare.txtHint - use the -c option for grep, also use the -i option so your count will also include "The", "THE", etcIn your shake.txt, you should have the number of lines that contain "the" (including "The", etc.), and also the percentage of the lines that contain the.


''Linux.7'' In your linux-bootcamp directory, create a text file weather.txt.  Copy the Indianapolis weather csv file from /var/junk/weather/ into your linux-bootcamp directory.  In your weather.txt file, put how many rows of data are in the csv file (use wc, head, and tail).  Assuming 365 days per year, put in your weather.txt file how many years of data are in the csv file.
''Text-based sftp program that is already installed on many systems - see OS Specific Notes below''


''Linux.8'' In your weather.txt file, put the maximum PRCP, SNOW, SNWD, TMAX, TMIN, MEAN from the csv file.  Hint - use the sort command, and use the options -t, -k, -n, -o.
==Text Editor==
Note that while you are using a terminal that is connected to the CS server you can use text-based editors - nano, emacs, vim, jove (see [[Linux Terminal - Text Editors]] for more on how to get started with these).  You will eventually want to have a good text editor on your personal computer.  


=Assignment 0=
The following are four good options that are cross-platform - can be installed on Mac, Windows, Linux, and Chromebook.  If you already use some other option (e.g., Visual Studio Code, Eclipse, Notepad++, or anything else that is used by programmers) feel free to keep using what you are already using.  Note that Word is ''not'' a text editor - it does not store files in plain text, which is what is needed for programming.
The following is a typical first assignment to get started in Linux on the CS server. Here we assume your login on the server is YOUR_LOGIN (this would typically be your_portal_id@isuad.indstate.edu).
* [https://kate-editor.org/get-it/ Kate] - make sure to download the "release" installer.
* [https://www.sublimetext.com/ Submlime] - used by Luke May.
* [https://www.gnu.org/software/emacs/ Emacs] - used by Jeff Kinne, click "GNU/Linux", "Windows", or "MacOS" depending on your OS and follow the instructions. 
** For Windows, download is from https://ftp.gnu.org/gnu/emacs/windows/, choose the latest emacs-## folder to click on, then download the zip file at the bottom that ends in "-x86_64.zip", extract the zip to somewhere to keep the program (e.g., C:\Program Files\), then run the file runemacs.exe in the bin directory.
** For macOS, the easiest install is from https://emacsformacosx.com/
* [https://www.vim.org/download.php Vim] - used by Geoff Exoo.  For Windows, download and run the "self-installing executable".  For macOS download and run MacVim.dmg from https://github.com/macvim-dev/macvim/releases/latest
* VS Code
* ne (nice editor)


==Account Configuration==
When starting a new text editor do an internet search for a tutorial to get you started; once you are comfortable with the basics do an internet search for a cheat sheet of keyboard shortcuts to help you remember them.
Bash reads configuration information from a file <code>~/.bashrc</code>.  A file with good defaults for the CS server are at [https://cs.indstate.edu/~jkinne/training_files/.bashrc .bashrc]. More help on bash - [https://www.gnu.org/software/bash/manual/ bash manual].


If you want to see what commands you have run in the current login session you can run the command <code>history</code>Bash also keeps history from previous sessions in the file <code>~/.bash_history</code>.
==Installing for Linux==
Most Linux distributions have their own package management systems, with the programs mentioned on this page being installable via the package management systemThere often is a graphical interface to the package management system, and there is normally a text-based interface - you type commands on the terminal to install packages.


You should create the following directories and use (a) your <code>bin</code> directory to put programs or scripts that you have downloaded or created that you want to be able to use, (b) your <code>programs</code> directory to put installation files for programs that you might need, (c) your <code>private</code> directory to keep files you want to make sure to keep private from other users, and (d) your <code>public_html</code> directory to store files that you want to be accessible on the web (at https://cs.indstate.edu/~YOUR_LOGIN).
''Debian'', ''Ubuntu'', and related Linux distributions use the APT package manager, and you can install the programs mentioned on this page by entering the following commands in the terminal.  Note that you will likely be asked in the terminal whether you want to install the package, you need to type Y and press enter.
<pre>
<pre>
mkdir ~/bin/
sudo apt update  # makes sure APT has the latest information about packages available
echo "export PATH=$PATH:~/bin/" >> .bashrc  # add the ~/bin/ directory to where shell looks for programs
sudo apt install emacs
mkdir ~/programs/
sudo apt install kate
mkdir ~/private/
sudo apt install gftp
chmod go-rwx ~/private/   # makes that directory not accessible to other users
sudo apt install vim
mkdir ~/public_html/
# Note - installing atom requires adding the repository where atom is kept
chmod go+rx ~/public_html/ # so the web server can access this directory
wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
chmod go+x ~              # so the web server can access your public_html
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt update
sudo apt install atom
</pre>
</pre>
Note that the web server is Apache, so if you want to configure how it processes files in your account, you should look for help on the Apache web server. It is also possible to run a web server using node.js; you can look up tutorials for how to do that.
''Other Linux distributions'' use different package managers.  If you use a different Linux distribution and are unable to figure out how to install packages you can ask your instructor, your advisor, or the CS system administrator.


==Copying/Creating/Editing Files==
After installing the above programs you can open them from the terminal (i.e., to open filezilla you type the command, filezilla).  The programs may also appear in the graphical menu of programs.
Create a file in your <code>public_html</code> directory, and practice copying a file from somewhere else on the system.
 
<pre>
==Chromebook==
cd ~/public_html
On Chromebook you can choose whether to install apps and do all of your work connected to the CS server, or install Linux on your Chromebook and then use the instructions above on installing the programs.
nano hello.txt  # or use your preferred editor - vim, emacs, jove, ...
 
# type something in your hello.txt file, save it, and
'''Using apps''' - Install the following apps.
# check that you can view it at https://cs.indstate.edu/~YOUR_LOGIN/hello.txt
* ''Text Editor'' - [https://chrome.google.com/webstore/detail/text/mmfbcljfglbokpmkimbfghdkjmjhdgbg?hl=en Text]
cp /usr/dict/words . # copies that file into current directory, which should still be your public_html
* ''Terminal Program'' - [https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo Secure Shell]
# now check https://cs.indstate.edu/~YOUR_LOGIN/words
* ''File Transfer Program'' - use the builtin Files app along with the Secure Shell app, configure as follows.
</pre>
** Open the Files app.
Create a sub-directory within your <code>public_html</code> directory, put some file there, edit the Apache configuration file (<code>.htaccess</code>) to allow directory listing of this directory (turned off by default for security reasons).
** Click on the triple-dots in the upper right of the Files app, click Add new service, click Secure Shell App.
<pre>
** On the Secure Shell App screen that comes up, enter your login information with cs.indstate.edu as the server and 22 as the port.  Then click SFTP Mount.
cd ~/public_html
** Go back to the Files app and you will see LOGIN@cs.indstate.edu:22 as an option on the left.
mkdir files_public
 
cd files_public
'''Linux (Beta) on Chromebook'''
echo "Options +Indexes" >> .htaccess
* Not all chromebooks allow installation of Linux (Beta). If this works then you will have Linux installed on your Chromebook and will be able to use any of the commands that you use on the CS server.
ls -a         # verify that the .htaccess file exists now
* Follow [https://support.google.com/chromebook/answer/9145439?hl=en instructions from google].
cat .htaccess # see what is in the file now
* Note - installation could take a very long time (e.g., an hour or more).  If installation fails you may need to select Remove Linux Beta and try again.
cp /var/junk/kinne/text-samples/shakespeare.txt .
* Once installation is complete you open a terminal using the Terminal app.  To install the programs mentioned on this page follow the instructions above for Linux (using the APT package manager commands).
cp /var/junk/kinne/text-samples/austen.txt .
* After the programs are installed you can open them by typing the command in the Terminal or by opening them as apps.
# Now browse to https://cs.indstate.edu/~YOUR_LOGIN/files_public
 
</pre>
'''Copy/paste''' - in either the Secure Shell app or the Terminal app, copy/paste as follows.  To copy, simply select text with the mouse and it will be copied to the clipboard.  To paste, do a triple-click (three finger click).
 
==Other OS-Specific Notes==
If you are using Windows and have Putty installed as your terminal program, it installs a text-based file transfer program as well - psftp - which you should be able to find in your list of programs. 
 
If you are using MacOS or Linux, a text-based file transfer program - sftp - is normally installed by default.
 
In either case, new users often prefer to use graphical file transfer programs (those mentioned above).
 
For the text-based sftp programs, the basic commands you will need.
* ls, cd, pwd - show you the files on the server and change directories on the server.
* lls, lcd, lpwd - show you the files on your computer and change directories on your computer.
* put - send a file from your computer to the server (from your current directory on your computer, to the current directory on the server).
* get - download a file from the server to your computer
* quit
 
==Compilers/Interpreters==
 
===Python===
 
===C/C++===
 
==Backing up Files - Rsync==
 
==GUI Programs X-Windows==
To run a GUI program while connected to the server, you will need to be running an X11 client on your local computer and have it running when connect to the server. Some further details depending on your operating system.
* MacOS - install [https://www.xquartz.org/ XQuartz] and run it.
* Windows - install [https://x.cygwin.com/ Cygwin/X] ([https://x.cygwin.com/docs/ug/setup.html#setup-cygwin-x-installing installation]) and run it. Or, euse the [https://learn.microsoft.com/en-us/windows/wsl/install Windows Subsystem for Linux] (WSL).
* Linux - do not need to install anything extra.
 
Once you have your X11 client installed, open it, and then connect to the CS server using the -Y switch in your ssh command: <pre>ssh -Y username@cs.indstate.edu</pre>


==Long Running Jobs==
To verify everything is working try running in your terminal xcalc: <pre>xcalc</pre>
If you have a process that needs to run for more than a few minutes, you should run it like this:
<pre>time nice -n 19 whatever_command</pre>
Starting the command with <code>time</code> will give you a printout afterwards of how much time the job took (<code>man time</code> for more details). Having <code>nice -n 19</code> makes your long running job run at a lower priority. Your job will finish just as fast, but it will interfere less with more important processes (other users on the system).


If the job is going to take an hour or more, you probably want to run it like this:
=Sample HW=
<pre>time nice -n 19 whatever_command > output.txt 2>stderr.txt &</pre>
The following might be used by your instructor as part of a HW assignment to verify you have your computer setup properly.
The <code> > output.txt</code> will have output go to the output.txt file, and <code> 2>stderr.txt</code> (no spaces is important) redirects error output to stderr.txt. The <code>&</code> will detach the process from your terminal so that it can continue running even if your terminal disconnects. You can login again and check on it by running <code>ps a</code> to see all your running processes (not just the ones started on the current login).


Alternatively to redirecting the output and detaching, you could use the <code>screen</code> command to run the command in a terminal that you can detach. You can lookup help on the screen command for how to do that (for example, [https://www.geeksforgeeks.org/screen-command-in-linux-with-examples/ here]).
# Follow the steps above to setup your computer with a file transfer program, text editor, and terminal program.  Make sure you are able to use the file transfer program and terminal programs to connect to your CS class account on the CS server.
# Make sure you can open the text editor. Create a text file aboutMySystem.txt and put the following information.
## Your name:
## Your CS class account:
## Operating System:
## Text editor you are using:
## File transfer program:
## Did you have any difficulties in getting the programs setup? If yes, explain.
# Create the following screen shots demonstrating that you have the programs installed on your system properly. Note - you can ask the internet how to take a screenshot (e.g., type in - how to screenshot on chromebook).  For each screenshot, make the screenshot of your whole screen (so I can see which OS you are running on and the program open and connected).
## textEditor.jpg - a screenshot that shows you editing the aboutMySystem.txt file with your text editor.
## fileTransfer.jpg - a screenshot that shows you using the file transfer program to connect to the CS server with your CS class account.
## terminal.jpg - a screenshot that shows you with the terminal program open and connected to the CS server with your CS class account.
# Use the file transfer program to connect to the CS server with your CS class account. 
## While connected, create a new directory in your CS class account on the CS server.  Name the new directory SystemSetup.
## Transfer the files you just created (aboutMySystem.txt, textEditor.jpg, fileTransfer.jpg, terminal.jpg) into the SystemSetup directory in your CS class account on the server.

Latest revision as of 12:12, 29 September 2025

This page is meant to help you get your computer ready to connect to the CS server.

Note - this page needs updating, was last updated in 2020.

CS User Accounts

Below we guide you through getting software setup on your computer. In order to connect to the CS server you will also need your CS user account; see CS accounts.

Your Personal Computer

You need to have access to a computer that you can install the following on - (a) terminal program used to connect to the CS server and execute commands on the CS server, (b) file transfer program for transferring files between your computer and the CS server, (c) text editor to use on your computer.

The minimum to get you started is to get a terminal program working. You can use the terminal program to connect to the CS server and do your work in the terminal. Eventually you will want to get setup with a file transfer program and text editor on your personal computer, but you can get started just with a terminal.

Terminal Program

A terminal program allows you to type commands to run programs and view files and folders on your computer, and allows you to do the same on a remote computer (i.e., the CS server) after you have connected to it.

If you are using MacOS, Linux, or an up to date Windows system then you already have a terminal program installed. You don't need to install anything, you just need to follow some steps to use the terminal program that is already installed.

Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect. Type or click yes.

  • On Windows - you have two options - use the built-in ssh client if your Windows computer is up to date, or install a terminal program. video demo of both options from around 2020
    • Built-in ssh - Click the start button, type cmd, click Command Prompt to open the command prompt program, then in this window type "ssh username@cs.indstate.edu" and then enter (but with your CS username) to start your connection to the CS server. Note that you need an up to date Windows 10 for the ssh program to be pre-installed.
    • Putty - download Installing Putty on Windows. Putty has some features that the built-in ssh client does not; either are sufficient to get started.
  • On Mac OS - Built-in Terminal - video demo Use the built-in Terminal program in Mac OS to connect to the cs server, and you can also use the Terminal program to run commands on your local computer. You open the terminal by opening Finder, then click on Applications, then click on Utilities, then open Terminal. When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).
  • On Chromebook - Install the Secure Shell app - video demo, Download Chrome Extension configuration
  • On Linux - Built-in Terminal - Similar to MacOS, a terminal program is already built-in. How to get to the terminal program (also called the "shell") depends on which distribution you are running - ask the internet where to find the terminal program for your distribution. When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).

File Transfer Program

You will eventually need to transfer files between your personal computer and the CS server. Most OSes have built-in support to do this, but there are other options that are easier to use. We recommend choosing a file transfer program to install. For Windows or Mac you will download the installer to install the program. If you are using Linux or Chromebook, see the sections below about these environments.

  • CyberDuck - works for MacOS or Windows, is freeware, click the large "Download for Windows" or "Download for macOS" in the middle of the page.
  • WinSCP - works for Windows, scroll past ads and click the "Download WINSCP" button.
  • gFTP - good option for Linux, see below about Linux for how to install.

Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect. Type or click yes.

Note - make sure to choose "sftp" as opposed to "ftp" when connecting. ftp is not encrypted and is disabled on the CS server (it will not work). sftp is encrypted and is what we use.

Text-based sftp program that is already installed on many systems - see OS Specific Notes below

Text Editor

Note that while you are using a terminal that is connected to the CS server you can use text-based editors - nano, emacs, vim, jove (see Linux Terminal - Text Editors for more on how to get started with these). You will eventually want to have a good text editor on your personal computer.

The following are four good options that are cross-platform - can be installed on Mac, Windows, Linux, and Chromebook. If you already use some other option (e.g., Visual Studio Code, Eclipse, Notepad++, or anything else that is used by programmers) feel free to keep using what you are already using. Note that Word is not a text editor - it does not store files in plain text, which is what is needed for programming.

  • Kate - make sure to download the "release" installer.
  • Submlime - used by Luke May.
  • Emacs - used by Jeff Kinne, click "GNU/Linux", "Windows", or "MacOS" depending on your OS and follow the instructions.
    • For Windows, download is from https://ftp.gnu.org/gnu/emacs/windows/, choose the latest emacs-## folder to click on, then download the zip file at the bottom that ends in "-x86_64.zip", extract the zip to somewhere to keep the program (e.g., C:\Program Files\), then run the file runemacs.exe in the bin directory.
    • For macOS, the easiest install is from https://emacsformacosx.com/
  • Vim - used by Geoff Exoo. For Windows, download and run the "self-installing executable". For macOS download and run MacVim.dmg from https://github.com/macvim-dev/macvim/releases/latest
  • VS Code
  • ne (nice editor)

When starting a new text editor do an internet search for a tutorial to get you started; once you are comfortable with the basics do an internet search for a cheat sheet of keyboard shortcuts to help you remember them.

Installing for Linux

Most Linux distributions have their own package management systems, with the programs mentioned on this page being installable via the package management system. There often is a graphical interface to the package management system, and there is normally a text-based interface - you type commands on the terminal to install packages.

Debian, Ubuntu, and related Linux distributions use the APT package manager, and you can install the programs mentioned on this page by entering the following commands in the terminal. Note that you will likely be asked in the terminal whether you want to install the package, you need to type Y and press enter.

sudo apt update  # makes sure APT has the latest information about packages available
sudo apt install emacs
sudo apt install kate
sudo apt install gftp
sudo apt install vim
# Note - installing atom requires adding the repository where atom is kept
wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt update
sudo apt install atom

Other Linux distributions use different package managers. If you use a different Linux distribution and are unable to figure out how to install packages you can ask your instructor, your advisor, or the CS system administrator.

After installing the above programs you can open them from the terminal (i.e., to open filezilla you type the command, filezilla). The programs may also appear in the graphical menu of programs.

Chromebook

On Chromebook you can choose whether to install apps and do all of your work connected to the CS server, or install Linux on your Chromebook and then use the instructions above on installing the programs.

Using apps - Install the following apps.

  • Text Editor - Text
  • Terminal Program - Secure Shell
  • File Transfer Program - use the builtin Files app along with the Secure Shell app, configure as follows.
    • Open the Files app.
    • Click on the triple-dots in the upper right of the Files app, click Add new service, click Secure Shell App.
    • On the Secure Shell App screen that comes up, enter your login information with cs.indstate.edu as the server and 22 as the port. Then click SFTP Mount.
    • Go back to the Files app and you will see LOGIN@cs.indstate.edu:22 as an option on the left.

Linux (Beta) on Chromebook

  • Not all chromebooks allow installation of Linux (Beta). If this works then you will have Linux installed on your Chromebook and will be able to use any of the commands that you use on the CS server.
  • Follow instructions from google.
  • Note - installation could take a very long time (e.g., an hour or more). If installation fails you may need to select Remove Linux Beta and try again.
  • Once installation is complete you open a terminal using the Terminal app. To install the programs mentioned on this page follow the instructions above for Linux (using the APT package manager commands).
  • After the programs are installed you can open them by typing the command in the Terminal or by opening them as apps.

Copy/paste - in either the Secure Shell app or the Terminal app, copy/paste as follows. To copy, simply select text with the mouse and it will be copied to the clipboard. To paste, do a triple-click (three finger click).

Other OS-Specific Notes

If you are using Windows and have Putty installed as your terminal program, it installs a text-based file transfer program as well - psftp - which you should be able to find in your list of programs.

If you are using MacOS or Linux, a text-based file transfer program - sftp - is normally installed by default.

In either case, new users often prefer to use graphical file transfer programs (those mentioned above).

For the text-based sftp programs, the basic commands you will need.

  • ls, cd, pwd - show you the files on the server and change directories on the server.
  • lls, lcd, lpwd - show you the files on your computer and change directories on your computer.
  • put - send a file from your computer to the server (from your current directory on your computer, to the current directory on the server).
  • get - download a file from the server to your computer
  • quit

Compilers/Interpreters

Python

C/C++

Backing up Files - Rsync

GUI Programs X-Windows

To run a GUI program while connected to the server, you will need to be running an X11 client on your local computer and have it running when connect to the server. Some further details depending on your operating system.

Once you have your X11 client installed, open it, and then connect to the CS server using the -Y switch in your ssh command:

ssh -Y username@cs.indstate.edu

To verify everything is working try running in your terminal xcalc:

xcalc

Sample HW

The following might be used by your instructor as part of a HW assignment to verify you have your computer setup properly.

  1. Follow the steps above to setup your computer with a file transfer program, text editor, and terminal program. Make sure you are able to use the file transfer program and terminal programs to connect to your CS class account on the CS server.
  2. Make sure you can open the text editor. Create a text file aboutMySystem.txt and put the following information.
    1. Your name:
    2. Your CS class account:
    3. Operating System:
    4. Text editor you are using:
    5. File transfer program:
    6. Did you have any difficulties in getting the programs setup? If yes, explain.
  3. Create the following screen shots demonstrating that you have the programs installed on your system properly. Note - you can ask the internet how to take a screenshot (e.g., type in - how to screenshot on chromebook). For each screenshot, make the screenshot of your whole screen (so I can see which OS you are running on and the program open and connected).
    1. textEditor.jpg - a screenshot that shows you editing the aboutMySystem.txt file with your text editor.
    2. fileTransfer.jpg - a screenshot that shows you using the file transfer program to connect to the CS server with your CS class account.
    3. terminal.jpg - a screenshot that shows you with the terminal program open and connected to the CS server with your CS class account.
  4. Use the file transfer program to connect to the CS server with your CS class account.
    1. While connected, create a new directory in your CS class account on the CS server. Name the new directory SystemSetup.
    2. Transfer the files you just created (aboutMySystem.txt, textEditor.jpg, fileTransfer.jpg, terminal.jpg) into the SystemSetup directory in your CS class account on the server.