Last updated on Sep 7, 2024, 19:56 by mokubo3

Hills Linux for CCSF Students

Starting a CS or CNIT career can be challenging, especially if you’ve never worked with Linux[1] before. Many CS and CNIT classes use Hills Linux. As a CS tutor, I’d like to share some tips that might be useful to help students get started with their first assignment on Hills Linux.

About Hills server

Hills server is running on the open-source[2] operating system Linux. Open-source means that the source code is public and built and maintained by contributors. Open-source projects supported by many developers tend to be safer and less prone to malware or other vulnerabilities compared to proprietary counterparts such as Windows or macOS.

Get connected to Hills

You may have been given instructions on how to connect to Hills using PuTTY[3]. Here, I would like to introduce you to how to use the ssh command in your terminal on macOS, Linux, or PowerShell on Windows.

To connect to Hills using ssh[4], replace <username> with your CCSF email account name (i.e., the part before @mail.ccsf.edu).
    [~] > ssh <username>@hills.ccsf.edu
    <username>@hills.ccsf.edu's password: 
    **********************************************************
    * W A R N I N G !                                        *
    *                                                        *
    * BY ACCESSING AND USING THIS SYSTEM YOU CONSENT TO      *
    * SYSTEM MONITORING FOR LAW ENFORCEMENT AND OTHER        *
    * PURPOSES.                                              *
    *                                                        *
    * UNAUTHORIZED USE OF THIS COMPUTER SYSTEM MAY SUBJECT   *
    * YOU TO CRIMINAL PROSECUTION AND PENALTIES.             *
    *                                                        *
    * DO NOT COPY OR INSTALL ANY ILLEGAL OR UNLICENSED       *
    * SOFTWARE ON THIS COMPUTER SYSTEM!                      *
    * Refer to CCSF Computer Usage Policy for additional     *
    * information: http://www.ccsf.edu/Policy/NEWpolicy.html *
    *                                                        *
    * INTERNSHIP INFORMATION is in /pub/cs/internships.txt   *
    *                                                        *
    **********************************************************
    
    Last login: Sat Sep  7 13:13:43 2024 from 255.255.255.0
    [test-user@hills ~]$
    

Once connected, you'll see ~ as your home directory, which was created by the IT department when you signed up for the class.

Linux Basics

The ping command is used to check the connection with remote or local servers.
    [test-user@hills ~] ping ccsf.edu
    PING example.com (123.45.67.89) 56(84) bytes of data.
    64 bytes from example.com (123.45.67.89): icmp_seq=1 ttl=53 time=22.7 ms
    64 bytes from example.com (123.45.67.89): icmp_seq=1 ttl=53 time=22.8 ms
    64 bytes from example.com (123.45.67.89): icmp_seq=1 ttl=53 time=22.7 ms
    64 bytes from example.com (123.45.67.89): icmp_seq=1 ttl=53 time=22.6 ms
    ^C
    --- ccsf.edu ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3000ms
    rtt min/avg/max/mdev = 20.000/22.000/25.000/0.150 ms
    [test-user@hills ~] 
    
Ctrl+C to exit program.

Essential commands

Below are some basic Linux commands, as referred to on grwoo[5]'s webpage on Hills:

ls

Lists files in the current directory. Use ll for a more detailed listing.

cd newdir

Changes the current directory to newdir.

mkdir newdir

Creates a new directory called newdir.

rm myfile

Removes the file called myfile (replace myfile with your file’s name).

cp oldfile newfile

Copies oldfile and names the copy newfile.

mv oldfile newfile

Moves or renames oldfile to newfile.

cat myfile

Displays the content of myfile on the screen.

more myfile

Similar to cat, but shows content one page at a time. Press space for the next page, or "q" to quit.

script myscript.txt

Starts logging terminal output to a file called myscript.txt. Remember to use exit to stop logging.

exit

Logs out or stops logging if using script.

Ctrl-C

Stops a running program. If your program is stuck or looping, use Ctrl-C to stop it. Make sure to stop any running programs before closing the terminal.

man xxx

Shows the manual page for a command. For example, use man ls to get more details about the ls command.

quota -v

Checks how much storage space you’ve used and how close you are to the limit.

Text Editor: nano/pico

Both nano and pico work similarly. To create a new file, just type nano in the terminal. To edit an existing file, use nano filename (replace filename with the actual file name). Save with Ctrl-o and exit with Ctrl-x. Commands are displayed at the bottom. To insert a saved file into the one you're editing, press Ctrl-R.


Questions?

If you have questions about your class or assignment, I recommend asking your TA or Professor. You can also get help from the CS Tutoring Squad at Batmale Hall 301 (ACRC) or via CS Tutor Zoom. For more information, please visit the Comupter Science Tutor Squad website to see the tutoring schedule, Zoom link, and make an appointment.

References

  1. Linux Kernel Archives: https://kernel.org/
  2. The latest on open source - The GitHub Blog: https://github.blog/open-source/
  3. PuTTY: https://putty.org/
  4. OpenSSH Manual Pages: https://www.openssh.com/manual.html
  5. Using Hills (Outdated since 08/31/2022): https://hills.ccsf.edu/~grwoo/using_hills.html