NDOS515_Session_2 Flashcards
“Desktop”…?
Shows up on your GUI desktop
“Documents”…?
for…documents.
“Bin”…?
holds “binaries” and executable scripts
“public_html”…?
(sometimes) has your Web page(s)
“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.
Linux Standard Directories:
/bin…?
Important executables.
Linux Standard Directories:
/etc…?
System configuration.
Linux Standard Directories:
/home…?
Users homes
Linux Standard Directories:
/tmp…?
Temporary Files.
Linux Standard Directories:
/user/bin…?
More executables.
Redirection:
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
Adding to a file…?
ls/bin»_space; listing.txt
Viewing files:
Short files can be viewed with…?
cat.
cat listing.txt
Viewing files:
For longer ones, use…?
Less
(less bigfile)
(type space to see more, q to quit, h for help)
Viewing files:
Use file to find out what something is…?
file /etc/passwd
Copy, rename/move, delete…?
- cp coolstuff coolstuff.bak
- mv coolstuff.bak backup
- mv backup my-backups/coolstuff.bak
- rm my-backups/coolstuff.bak
Unix (and Linux) is design on the assumption that you don’t like…?
Chatty computers.
Success in Linux is generally indicated by…?
Silence:
(rm backup
rm backup2
rm: cannot remove ‘backup2’: No such file or directory)
Directory Management:
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!)
Globbing:
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.
What is 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.
Simple Editors on Linux:
Nano…?
- Command-line
- Fairly easy to start with
- Word-wraps by default, which can be problematic
Simple Editors on Linux:
gedit…?
- GUI
- Easy to get going
Powerful Linux Editors:
vi…?
- Command line
- Hard to learn
- Modal
- Popular with many (because they learned t first?)
Powerful Linux Editors:
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)
Best way to choose an editor…?
- Decide how much work you’re willing to put out.
- Try at least two
- Give enough time to actually learn them well
- Choose significantly different ones.
- Pick based on what fits your preference and needs.
- DON’T choose one just because your friends use it.