Summet 2014"Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface." - Doug McIlroy
man (manual)
example: man man
options that can be run with a command.
Flags start with - or ---fdacds
--location --name
-x true -v fales --dir foobar
~ home
/ root
. Current directory
.. Parent directory
cd (change directory)
Defaults to home
Create
Read
Update
Delete
Defaults to current directory
authorize.php install.php robots.txt
CHANGELOG.txt INSTALL.sqlite.txt scripts
COPYRIGHT.txt INSTALL.txt sites
cron.php LICENSE.txt themes
includes MAINTAINERS.txt update.php
index.html misc UPGRADE.txt
index.php modules web.config
INSTALL.mysql.txt profiles xmlrpc.php
INSTALL.pgsql.txt README.txt
Use a long listing format
total 244
drwxr-xr-x 3 knectar knectar 4096 Jan 4 2013 cache
drwxr-xr-x 3 knectar knectar 4096 Nov 13 2012 entry
drwxr-xr-x 3 knectar knectar 4096 Nov 13 2012 includes
-rw-r--r-- 1 knectar knectar 3259 Jan 4 2013 index.php
drwxr-xr-x 4 knectar knectar 4096 Nov 13 2012 misc
drwxr-xr-x 15 knectar knectar 4096 Nov 13 2012 modules
-rw-r--r-- 1 knectar knectar 720 Nov 13 2012 robots.txt
drwxr-xr-x 5 knectar knectar 4096 Nov 13 2012 sites
drwxr-xr-x 4 knectar knectar 4096 Nov 13 2012 themes
total 244 -rw-r--r-- 1 knectar knectar 3259 Jan 4 2013 index.php
Do not ignore entries starting with .
. index.php profiles .. INSTALL.mysql.txt README.txt INSTALL.mysql.txt README.txt authorize.php INSTALL.pgsql.txt robots.txt CHANGELOG.txt install.php scripts COPYRIGHT.txt INSTALL.sqlite.txt sites cron.php INSTALL.txt themes .gitignore LICENSE.txt update.php .htaccess MAINTAINERS.txt UPGRADE.txt includes misc web.config index.html modules xmlrpc.php
Dot files are hidden files on a Unix file system.
more or less
Creating directories
mkdir foo
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask
-p, --parents no error if existing, make parent directories as needed
-v, --verbose print a message for each created directory
-Z, --context=CTX set the SELinux security context of each created
directory to CTX
--help display this help and exit
--version output version information and exit
mkdir foobar_file
(used for moving files and folders another location. Commonly used for renaming a folder)
cp foo.txt ~/Documents/bar.txt
&
(basics)
http://www.viemu.com/vi-vim-cheat-sheet.gif
(the most of the movement and edit functions will work well but I want to mention Y for yank and D for delete, but it will also serve as a Cut function. You can P to paste the deleted or yanked string.)
commands
Basics
all you need to delete everything.
(again the the --help flag output is to long for a slide but we will cover the ones I use the most)
rm -f file (
rm -d directory
rm -rf ../../foo*
By default almost every one will be using a shell called BASH.
The Trending shell today is Zshell.
$EDITOR=vim
export PATH="$HOME/.composer/vendor/bin:$PATH"
alias vhost="sudo ~/bin/vhost"
alias vi="gvim --servername GVIM"
##############
## Bash prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
case $TERM in
xterm*)
TITLEBAR=''
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
$BLUE[\w$GREEN\$(parse_git_branch)$BLUE]\
$GREEN\$ "
PS2='> '
PS4='+ '
}
proml