NDOS515_Session_2 Flashcards

1
Q

How to Organize your tree…?

A
  • Some conventions:
    • Desktop shows up on your GUI desktop
    • Documents for …. documents.
    • bin holds “binaries” and executable scripts
    • public_html (sometimes) has your Web page(s)
  • Otherwise, pretty wide open
    • Two suggestions:
      1. Think about it early on
      2. Be willing to reorganize from time to time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Navigating on Command line

A
  • pwd tells where you are
  • cd to get to a new directory (folder)
  • ~ refers to your home
    • cd ~
    • cd ~/music
  • Leading slash (or ~) means “start at top”
    • Absence of slash means “from here”
    • cd ~/music/elvis
    • cd ~/music; cd elvis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Linux Standard Directories

A
/bin		Important executables
/etc		System configuration
/home	User homes
/tmp		Temporary files
/usr/bin	More executables

(There are more than just these…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Redirection…?

A

The output of any command can be captured into a file:
ls > listing.txt
(Note: “.txt” isn’t necessary and is omitted by experienced Unix users)

You can add to a file, too:
ls /bin&raquo_space; listing.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Viewing files…?

A
Short files can be viewed with cat:
	cat listing.txt
For longer ones, use less:
	less bigfile
(type space to see more, q to quit, h for help)
Use file to find out what something is:
	file /etc/passwd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Copy, rename/move, delete…?

A

cp coolstuff coolstuff.bak
mv coolstuff.bak backup
mv backup my-backups/coolstuff.bak
rm my-backups/coolstuff.bak

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A Philosophical Note…?

A

Unix (and Linux) is designed on the assumption that you don’t like chatty computers
Success is generally indicated by silence:
rm backup
rm backup2
rm: cannot remove `backup2’: No such file or directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Directory Management…?

A

For historical reasons, directories are handled differently:
mkdir backups
rmdir obsolete
cp –r public_html backups/web-backup
rm –r backups
WARNING!!! rm –r is extremely dangerous. Never type Enter until you’ve triple-checked what you typed!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Globbing…?

A
It’s a pain to type lots of file names, so you can abbreviate:
ls a*
less *.txt
	(omits files starting with dot…why?)
ls .??*

More choices, but these are common ones

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Editors..?

A

What’s an editor?
- Shows you exactly what’s in the file
- Give you control over file contents
- Can be hard to learn
What’s a word processor?
- Usually easy for beginners to get started
- Puts priority on formatting and layout
- Shows you what printed page will look like
- File contents are very different from what you see

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Simple Editors on Linux

A
Nano
 - Command-line
 - Fairly easy to start with
 - Word-wraps by default, which can be problematic
gedit
 - GUI
 - Easy to get going
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Powerful Linux Editors

A

vi
- Command line
- Hard to learn
- Modal
- Popular with many (because they learned it first?)
emacs
- Command line or GUI
- Hard to learn
- Amazingly powerful and flexible (too much?)
- Lets you click, type, use arrow keys and mouse (non-modal)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Religious Wars

A

Linux users get heated about editors
Criticize non-favorites, support their own
Don’t make decisions based on logic
Best way to choose an editor:
1. Decide how much work you’re willing to put out
2.Try at least two
- Give enough time to actually learn them well
- Choose significantly different ones
3. Pick based on what fits your preferences & needs
- DON’T choose one just because your friend uses it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The second lab

A

Review of
The ls, cat commands; file system layout and navigation.
Globbing
File redirection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly