ls
-a ls ls
ls path/to/folder
path/to/folder
Random File Random\ File
"Random File"
ls -l -a Documents/
ls ls
-a -l -a ls -l ls
Documents/ ls
Documents
ls -l -a Documents/
ls -la Documents/
grep
-C grep
grep
-C 1 grep
-C1 -C=1
grep
--count
grep --count no file 1
pwd
cd
pwd astanesc/ cd Documents/
pwd astanesc/Documents/
ls
cd
15122 Documents
cd Documents cd 15122 cd Documents/15122
/
/afs
~
/afs/andrew.cmu.edu/usr23/acarnegie
/afs/andrew.cmu.edu/usr23/acarnegie/Documents ~/Documents
.
.. ~/Documents/15122/code/
~/Documents/15122/
vim emacs
file path/to/
% vim path/to/file
% emacs path/to/file
rm file path/to/
% rm path/to/file
rm: cannot remove ’path/to/dir’: Is a directory
-r
-i
cp file original/path/to/
new/path/to/
% cp original/path/to/file new/path/to/file
newname
% cp original/path/to/file new/path/to/newname
% cp original/path/to/file new/path/to/file
% cp original/path/to/file new/path/to/
.
% cp original/path/to/file .
rm -i
mv file original/path/to/
new/path/to/
% mv original/path/to/file new/path/to/file
newname
% mv original/path/to/file new/path/to/newname
% mv original/path/to/file new/path/to/file
% mv original/path/to/file new/path/to/
cp
rm -i
mkdir newdir
path/to/
% mkdir path/to/newdir
grep
file path/to
% grep "some text" path/to/file
grep
ssh
scp scp
cp
% scp ANDREWI[email protected].cmu.edu:path/to/file ./
ssh
~/private/15122/importantfile.txt
[email protected]:private/15122/importantfile.txt
cp
% scp ANDREWI[email protected].cmu.edu:path/to/file ./new
_
file
_
name
% scp path/to/file ANDREWI[email protected].cmu.edu:new/path/to/
scp
ssh
OldFiles
OldFiles
.zip
.tar
.gz
.zip
.tar.gz
.tgz .zip
tar
file1 file2 file3 file4 result.tgz
% tar -czvf result.tgz file1 file2 file3 file4
-c
-z
-v
-f result.tgz result.tgz
-c
-x result.tgz
% tar -xzvf result.tgz
tgz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
-z
cmd % man cmd
grep
grep
grep, egrep, fgrep --- print lines matching a pattern
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
PATTERN
grep
[OPTIONS]
[XXX | YYY]
FILE...
grep [OPTIONS] PATTERN [FILE...] grep
grep
grep
grep
-s --no-messages
-s, --no-messages
Suppress error messages about nonexistent or unreadable files.
--help -h