-
Notifications
You must be signed in to change notification settings - Fork 0
shell
Joey Kleiner edited this page Jan 25, 2023
·
32 revisions
- Shebang:
#!interpreter [optional-arg] - A shebang is only used when a script has the execute permission (e.g. chmod u+x script.sh).
- When a shell executes a script it will use the interpreter specified in the shebang
#!/bin/csh
# see jobs running
jobs
# The fg command switches a job running in the background into the foreground
fg nano HYDR.py
# change permissions on all files in a directory (Required for HSP2 work):
jkleiner@deq3:/opt/model/HSPsquared$ sudo chgrp modelers HSP2/* -R
jkleiner@deq3:/opt/model/HSPsquared$ sudo chmod g+w HSP2/* -R
# change file owner and group information
chown
# Search shell command history
history | grep "STRING_TO_SEARCH_HERE'
# cron: https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/#:~:text=Cron%20allows%20Linux%20and%20Unix,%2Ftmp%2F%20directories%20and%20more.
# the cron service (daemon) runs in the background and constantly checks the /etc/crontab file, and /etc/cron.*/ directories
ssh -p '311' 'jkleiner@deq1.bse.vt.edu'
sudo su -
cd /etc/cron.daily
cat deq-drought
# contains the shebang: #!/bin/sh
# run the cron script:
#./deq-drought
nohup ./deq-drought
# see contents of the nohup file:
tail -f nohup.out
cat /etc/crontab
# It runs all scripts in /etc/cron.daily/ once a day
Also, here is the command to make sure that we both can do stuff in there once you are back in sudo:
sudo chgrp modelers .git
sudo chgrp modelers .git/* -R
sudo chmod g+w .git/* -R