CSCI 1006 Lecture Notes - Lecture 6: Grep, Mkdir, Compiled Language
Terminal Basics
● username @ computer : ~ $
● ~ → slot for directory, stands for home directory if left as is.
● Commands:
● “ls” → lists files.
■ “ls -l” → files in long form.
■ “ls -a” → all files displayed, including hidden files, which are usually files
the user does not modify. (Any file that begins with a “.” is hidden.)
● “cd <directory>” → change directory.
● “cat <file name>” → displays a file in the terminal.
■ It is a text-only session, and the user cannot scroll.
■ Doing this to a non-text file will show numerical representations. ASCII
code, for example, uses numbers to replace characters.
● “less <file name>” → displays a file with scrolling enabled.
■ The last line on the screen is highlighted.
■ It starts at the top of the file.
■ No command prompt is available, so enter must be pressed to proceed to
the next page.
■ Q → quits the display.
■ It warns you if a file is binary.
● “grep <word> <file name>” → searches for a word within a particular file.
■ “grep <word> *” → searches for lambda in the entire directory, excluding
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
~ slot for directory, stands for home directory if left as is. Ls -a all files displayed, including hidden files, which are usually files the user does not modify. (any file that begins with a . is hidden. ) Cat displays a file in the terminal. It is a text-only session, and the user cannot scroll. Doing this to a non-text file will show numerical representations. Ascii code, for example, uses numbers to replace characters. Less displays a file with scrolling enabled. The last line on the screen is highlighted. It starts at the top of the file. No command prompt is available, so enter must be pressed to proceed to the next page. It warns you if a file is binary. Grep searches for a word within a particular file. Grep * searches for lambda in the entire directory, excluding hidden files. Man displays the manual for a command.