Slides available at: http://kansascitywomenintechnology.github.io/CommandLine
In January we learned about HTML & CSS. We covered:
Text-based interface to interact with your computer
Enter input and return output
pwd
ls
cd Documents
HELP! I don't know what I'm doing!
hint: check the online man pages or type "man ls"
cd ~
mkdir CodingAndCocktails
ls
make sure we have windows explorer or mac finder open!!!
cd CodingAndCocktails
touch myNewFile.txt
ls
cp sourceFile destinationFile
cp myCocktailList.txt newCocktails.txt
ls
mv /path/to/sourceFile /path/to/destinationFile
mv newCocktails.txt renameCocktails.txt
ls
rm renameCocktails.txt
ls
cat to view entire file
tail -n to view the last n lines
head -n to view the first n lines
cat myCocktailList.txt
tail -2 myCocktailList.txt
head -2 myCocktailList.txt
grep - global regular expression print
grep Mar myCocktailList.txt
find
find . –name "*.txt" –mtime 5
grep Mar myCocktailList.txt | wc -w
echo "Bloody Mary" >> myCocktailList.txt
cat myCocktailList.txt
added by editing the cron file
specify the schedule you want to run on and the script or command you want to run
* * * * * command to be executed | | | | |_ day of week (0 - 6, 0 = Sunday) | | | |___ month (1 - 12) | | |_____ day of month (1 - 31) | |_______ hour (0 - 23) |_________ minute (0 - 59)