wednesday 1/26 - Basic Unix - Directory structure Directories special directories . Current directory .. Parent directory / Root directory Files blocks/k A block is typically 512bytes (1k = 2 blocks) -k to many commands shows 1k vs blocks. Inodes Pointers to file address(es) Interaction Manipulation mkdir -p [creates all parent directories] rmdir -p [removes all empty parent directories] mv -i [ask for each potential overwrite] -f [will not ask, will overwrite] cp -i [ask for potential overwrite] -p [preserve file permissions/owner] -r [recursively] -R [recursive, replicate pipes] vs 'tar' for links rm -i [ask for each file] -f [do not ask for anything] -r [recursive downwards] "rm -r *" or "rm -rf *" ln ln expects you to be in the directory for the target -s [create symbolic link: Special file that lists the location of the specified directory entry. Can point to non-existant location. Required for directories on most systems] Viewing ls -s [list sizes] -k [some ls's list 1024byte instead of 512/block] -C [columnar] -F [show special status: / for directory * for executable @ for symlink] -a [show files starting with .] -A [some ls's list start with ., not ./..] -l [long listing format] -i [list inode] cd pwd "Current working directory" df -k [list in 1024bytes vs 512byte blocks] du -k [list in 1024bytes vs 512byte blocks] -s [sum of selected items/dirs] cat more lists in chunks head Lists start of files tail Lists ends of files -f [stay at end and show additions] Other commands su Without arg, attempts to become root with username, attempts to become that user su - will attempt to setup environment as if they'd logged in echo prints the string specified (often used for scripts) echo * shows directory entries w who These show various users online and some information about them id Specify the username and group id's the system sees you as currently. Useful after su/sudo to determine what user you are for running/permissions last [name] Show the last logins/matched logouts/etc 'last reboot' shows official reboots date Shows system date man Show the help for the command, if available Command usages stdin/stdout/stderr stdin is the pseudofile the text from a user or going "in" to a command. stdout is the data printed out from the command stderr is the data printed out from the command noted as 'error' args many arguments are '-' or '-