CSCI 1006 Lecture Notes - Lecture 6: Grep, Mkdir, Compiled Language

19 views3 pages
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
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents