##Digital Humanities Lab, 2.11. 2014 #Command Line Basics
##Basic Commands
Command | Description |
---|---|
pwd | present working directory |
ls | list (the entries in the pwd) |
cd [directory] | change directory |
cd .. | back |
cd - | get back to the last place you were in |
mkdir [directory name] | makes a folder |
touch [file] | create a file |
man [command] | manual for some command |
rm [file] | removes file |
rm -r [directory] | remove recursively (NOTE: flags) |
rm -ir [directory] | remove interactively and recursively (NOTE: chaining flags together) |
cp [file] [directory] | makes a duplicate of [file] in [directory] |
mv [file] [new name] | rename |
mv [file] [directory] | move a file (NOT duplicate) |
history | view commands you've typed in the past |
##Advanced Commands
Command | Description |
---|---|
pushd | saves the directory you specify |
popd | pops to the directory you specified in pushd |
ctrl-r | search based on history (great for SSH) |
ctrl-a | beginning |
ctrl-e | end |
grep | regular expressions |
find |