task-optimization-slides
task-optimization-slides
Mateo Prigl
SOFTWARE DEVELOPER
Demo
Brace expansion
Demo
Regular files
Match patterns with wildcards
* matches zero or more characters
nano vi emacs
Page through the file with more and less
stdin stdout
Command
0 1
stderr
2
Redirect standard input with <
Execute
Execute (x) (executable file)
Enter inside (cd into it)
Changing Permissions
File Permissions (symbolic mode)
u user
= set permissions
g group
- remove permission
a all
Changing Permissions
File Permissions (absolute/numeric mode)
4 2 1
r w x
1 0 0 1 --x
chmod 2 0 1 0 -w- filename
4 1 0 0 r--
1+2=3 0 1 1 -wx
Default UNIX Permissions
666 777
rw-rw-rw- rwxrwxrwx
Default File Permissions
Default
6 6 6 rw-rw-rw-
permissions
Run file as a
All of the files inside of it will
SGID (s or S) member of the
belong to the directory group
file group
Prevents files inside of it from
Sticky bit (t or T) being removed by anyone but
the owner of that file
Copy files with cp
Hold buffer
AWK Workflow
awk
'BEGIN {
print "execute before everything"
}
/expression/ {
print "execute on each line from the input stream"
}
END {
print "execute after everything"
}'
filename
Tar Options
Option Purpose
v Verbose output
z Gzip compression
j Bzip2 compression