Get the history: history
Hit a history number (bang): !56
Finding things in the history: history | grep export
Print working directory: pwd
Find a file: find . -name *.*
Funky find and replace:
nice perl -p -i.bac-2006-03-31 -e ’s{/dealerextranet}{/dealers}’ ` grep -rl ‘/dealerextranet’ . `
Search history:
ctrl - r
Find in what commands use that function: apropo
for example: apropo cut - finds all of the relevant uses for cut
chmod lots of files:
find . -type f -exec chmod 0644 {} \;
chmod lots of directories:
find . -type d -exec chmod 0644 {} \;
-type d = directories
cut -d: -f1,1
Tars up and then un-tars to the correct directory!!!!!!!!
cd for_upload && tar -cf - * | ssh jhinton@dt ‘(mkdir -p testsite && cd testsite && tar -xf -)’
run two commands in a line: first command && second command
wc -1
gives file count eg:
grep -rl ‘test’ . | wc -1
will output the number of files found in that grep
jobs —- lists all the current jobs running
kill %2 —– will kill job 1
kill %1 —– will kill job 2
mount ——- gives you all the info about the drives including their permissions and file format