mywiki:linux:linuxadmin
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mywiki:linux:linuxadmin [2015/02/27 08:33] – shaoguoh | mywiki:linux:linuxadmin [2019/09/15 18:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| Linux Admin | Linux Admin | ||
| - | | Reference | [[http:// | + | | Reference | [[http:// |
| - | ====== Schedule | + | ====== Schedule |
| - | | Display all scheduled tasks/scripts | crontab | + | Linux cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis. |
| + | | Display all scheduled routine | ||
| + | | Add a scheduled routine | crontab -e | | ||
| - | ====== | + | Routine Format Example: |
| + | 0 4 * * * / | ||
| + | |||
| + | By the way, first 5 digits means: MIN HOUR DOM MON DOW CMD | ||
| + | |||
| + | 0 – 0th Minute | ||
| + | 04 – 04 AM | ||
| + | * – every day | ||
| + | * – every month | ||
| + | * – Every day of the week | ||
| + | |||
| + | ====== User groups management ====== | ||
| + | | Set user to a primary group list only | usermod -G groups | ||
| + | | Add user to other groups based on current groups | usermod -aG additional_groups username | | ||
| + | | Display user's groups | groups username | | ||
| + | |||
| + | ====== | ||
| + | * echo $0 - will print the program name... which in the case of shell is the actual shell | ||
| + | * ps -ef | grep $$ | grep -v grep - will look for current process ID in the list of running processes. Current process being shell, it will include shell. This is not 100% reliable | ||
| + | * echo $SHELL The path to the current shell is in SHELL variable for any shell. it seems not reliable ?? | ||
| - | For example, add user jerry to groups ftp, www_data: | ||
| - | useradd -G ftp, | ||
| ====== Shorthand at the Command Prompt ====== | ====== Shorthand at the Command Prompt ====== | ||
mywiki/linux/linuxadmin.1424997212.txt.gz · Last modified: (external edit)
