03112014 Flashcards

0
Q

Search for files in a directory hierarchy

A

find

cd /usr
find -name bash
find -name bash*
find -name bin

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

A file can be copied from another location to the current directory

Example:
1. Create “somefile” in /tmp and copy to your current directory

  1. Copy bash file from /bin to /tmp
A

cp /tmp/somefile

cp /bin/bash /tmp

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

Find files by name

A

locate

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

The ____ command uses the updatedb database to find files or directories on the entire system

A

locate

locate gnome-terminal
locate vim
locate ifconfig
locate -i sudo

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

CREATING TEXT FILES -VIM

A
cd /tmp
vim lbookfile1.txt
Press A
Type some words
Esc to get out Insert Mode
Press : to enter command mode
w to save file
wq to save and quit vim
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

CREATING TEXT FILES -EMACS

A
cd /tmp
emacs -nw lbooktest3.txt
type a few lines
Ctrl C and then ctrl S
Ctrl H for help
Ctrl x
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Determine file type

A

file

A binary file is what the computer “reads” (e.g. vim is a binary file)

cd /tmp
ls > temp.txt
file temp.txt
file /bin/bash

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