Linux Distributions:
- Debian: upstream for Ubuntu, Linux Mint, and others. Purely open source focus on stability.
- Red Hat: CentOS Stream is very close to Red Hat Enterprise Linux.
- OpenSUSE
How to Setup sudo:
- Use
su to switch to root
- Go to
/etc/sudoers.d , edit the file using visudo, and add the line:
{username} ALL=(ALL:ALL) ALL
The line has the following meaning:
- {username} ALL=(ALL:ALL) ALL: Rule applies to all hosts
- {username} ALL=(ALL:ALL) ALL: The user can run commands as all users
- {username} ALL=(ALL:ALL) ALL: The user can run commands as all groups
- {username} ALL=(ALL:ALL) ALL: The rules are applied to all commands.
- Add the following to
PATH=$PATH:/usr/sbin:/sbin to the .bashrc file in the home directory.
Common Bash Redirectors:
- >: Redirects STDOUT. If redirection is to a file, the current contents of that file are overwritten.
- »: Redirects STDOUT in append mode. If output is written to a file, the output is appended to that file.
- 2>: Redirects STDERR.
- 2>&1: Redirects STDERR to the same destination as STDOUT.
- <: Redirects STDIN.
Using Cron
- Be careful of the difference between system-wide cron(Runs by root) and user cron(run by users)
- Crontabs are at /etc/crontab
Cronline:
1: Minute
2: Hour
3: Day of the month
4: Month of the year
5: Day of the week
Use / to indicate repeat of every time interval.
To add a new cronjob. Run: