FLAGS
-r: recursive
-v verbose
rm: remove
rm [file1 file2]
rm –R will recursively delete a folder. Notice cap R, which is a naughty deviation from the usual –r flag
CP: copy
cp [source][/source] [destination]
MV: MOVE
mv [source language=”destination”][/source]
TREE
shows a tree representation of a [target]
MKDIR: MAke directory
mkdir [name]
MKDIR: MAke directory
mkdir [name]
mkdir –p [multiple levels deep defined] will create a full directory structure in one go
ZIPPING
gzip only does compression, not packing of multiple files and folders into an archive.
tar –czvf [name of compressed file] [target dir]
-c: create|
-z: zip (uses gzip)
-v: verbose
f: name of compressed file follows
tar –xvf [name of compressed file]
-x: extract
PERmissions
You can set permissions for the User, Group and Others
Permissions are either:
r: read names of files in dirs [4]
w: write [2]
x: execute [1]
The drwx—— weirdness above is actually:
[d/-] directory or file
rwx for current user
rwx for current group
rwx for others
CHMOD: change permissions on file system object
chmod [-R] u+w [file]
add w to user on the [file]
-R would do it recusively for all files in dir
chmod g-rw [file]
remove read and write permissions on the file for the current user group
chmod u=rwx,go=r (notice no spaces)
give the current user rwx and the group and others r only
CHOWN: change owner
root user only
chown [new owner] [file]
CHgrp: change group
current owner only
chgrp [-R] [groupname] [file]
now file permissions will effect everyone in the [groupname] group