There is obviously a lot more than this, so I’ll add more as I encounter and use them.
Last updated on: July 6, 2016.
- Switching to root once you get in, if needed:
Where to find things
- Site roots:
/var/www/if a single site,
/var/www/vhostsif multiple sites on virtual host infrastructure
- Config files:
Changing directories, creating files and directories, viewing text files
- Changing directory:
- Going up one directory:
- Creating files:
- Creating directories:
- Viewing text files:
- Closing out of
Wget retrieves content from web servers.
-O- Which output file the file you are downloading should get written to.
-q- Quiet mode. Doesn’t show the download status and other output.
Example - Getting a file from the web:
Reading the manual for commands
Cron is a time-based job scheduler in Linux and Unix. Here is my full TIL on cron.
Load your personal crontab (cron table) file:
View your personal crontab:
|min||hour||day of month||month||day of week||command|
|0 - 59||0 - 23||1 - 31||1 - 12||0 - 6 (0 to 6 are Sunday to Saturday)||shell command you want to run at that time|
Examble: Download a JSON file from Quandl and overwrite GOLD.json with it Monday through Friday at 5pm server time
Display a date and time:
$ datespits out the date and time on the server
$ TZ=US/Pacific datespits out the server’s date and time adjusted to the Pacific timezone
TZ=US/Eastern date -d 'Tue Jul 5 10:43:07 PDT 2016'converts the timestamp in the
-doption to the Eastern timezone.
date -d @1467740657converts UNIX timestamps to something you can actually read
Eric Davis has a Simple CLI date calculator writeup on his site.