Week 1 - Navigating a Command Line Interface

Navigating a Command Line Interface (CLI)

Agenda

  • Connecting to a remote server

  • Using a Shell (CLI)

  • Common UNIX Utilities

  • Working with Directories

  • File Permissions

CLIs are command-based interfaces, with shells as the main type. A shell is a command interpreter that communicates with the OS. Popular shells include Bourne Shell, Korn Shell, C Shell, and Bash. Shell scripts consist of multiple commands in text files.

Connecting to a Remote Server

  • Snowball: instructional server for the course.

  • Login Methods: locally (username/password) or remotely (SSH/telnet with GSU single sign-on).

  • SSH Protocol: secure network protocol for encrypted data transfer via SSH client/server.

Running Utilities/Commands

  • Use command after the prompt (e.g., ls, pwd). Logout with exit or CTRL+D.

  • Common Keyboard Shortcuts: CTRL-C (interrupt), CTRL-Z (suspend), CTRL-D (EOF).

Common UNIX Commands

  • Utilities: ls, cat, more.

  • Working with Directories: mkdir, rmdir, cd, pwd.

  • File Manipulation: mv, cp, rm.

  • File Permissions: wc, chgrp, chmod.

Navigating in the Terminal

  • Commands: cd [directory], ls [-flags].

  • Pathnames: Absolute (e.g., /home/user/file.txt) vs. Relative (e.g., ./file.txt).

Show File Contents

  • cat <file> for all, more <file> for one screen at a time.

Removing Files

  • Command: rm <file-spec> (use caution).

Word Count

  • Command: wc -clw <file-spec> for word counts.

File Attributes

  • Format: -rw-rw-r-- indicates file type and permissions.

Groups Management

  • Commands: groups <userid>, chgrp <group-name> <file-spec> to change file group.

Changing File Permissions

  • Command: chmod <u g o a>(+-)<r w x s> <file-spec>, e.g., chmod g+w <file-spec> to add write permission to group.