mywiki:linux:linuxadmin
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mywiki:linux:linuxadmin [2014/07/21 06:07] – external edit 127.0.0.1 | 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:// | ||
| - | ====== | + | ====== |
| + | 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. | ||
| - | For example, | + | | 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 username | ||
| + | | Add user to other groups based on current groups | usermod -aG additional_groups username | | ||
| + | | Display user's groups | groups username | | ||
| + | |||
| + | ====== how to know current shell ====== | ||
| + | * 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 ?? | ||
| + | |||
| + | |||
| + | |||
| + | ====== Shorthand at the Command Prompt ====== | ||
| + | * / : root directory | ||
| + | * ./ : current directory | ||
| + | * ./ | ||
| + | * ../ : parent directory | ||
| + | * ~ : home directory | ||
| + | * $ : typical prompt when logged in as ordinary user | ||
| + | * # : typical prompt when logged in as root or superuser | ||
| + | * ! : repeat specified command | ||
| + | * !! : repeat previous command | ||
| + | * ^^ : repeat previous command with substitution | ||
| + | * & : run a program in background mode | ||
| + | * Tab][Tab] : prints a list of all available commands. This is just an example | ||
| + | * x[Tab][Tab] : prints a list of all available completions for a command, where the beginning is ``x'' | ||
| + | * [Alt][Ctrl][F1] : switch to the first virtual text console | ||
| + | * [Alt][Ctrl][Fn] : switch to the nth virtual text console. Typically, there are six on a Linux PC system. | ||
| + | * [Alt][Ctrl][F7] : switch to the first GUI console, if there is one running. If the graphical console freezes, one can switch to a nongraphical console, kill the process that is giving problems, and switch back to the graphical console using this shortcut. | ||
| + | * [ArrowUp] : scroll through the command history (in bash) | ||
| + | * [Shift][PageUp] : scroll terminal output up. This also works at the login prompt, so you can scroll through your boot messages. | ||
| + | * [Shift][PageDown] : scroll terminal output down | ||
| + | * [Ctrl][Alt][+] : switch to next X server resolution (if the server is set up for more than one resolution) | ||
| + | * [Ctrl][Alt][: | ||
| + | * [Ctrl][Alt][BkSpc] : kill the current X server. Used when normal exit is not possible. | ||
| + | * [Ctrl][Alt][Del] : shut down the system and reboot | ||
| + | * [Ctrl]c : kill the current process | ||
| + | * [Ctrl]d : logout from the current terminal | ||
| + | * [Ctrl]s : stop transfer to current terminal | ||
| + | * [Ctrl]q : resume transfer to current terminal. This should be tried if the terminal stops responding. | ||
| + | * [Ctrl]z : send current process to the background | ||
| + | * reset : restore a terminal to its default settings | ||
| + | * [Leftmousebutton] : Hold down left mouse button and drag to highlight text. Releasing the button copies the region to the text buffer under X and (if gpm is installed) in console mode. | ||
| + | * [Middlemousebutton] : Copies text from the text buffer and inserts it at the cursor location. With a two: button mouse, click on both buttons simultaneously. It is necessary for three: button emulation to be enabled, either under gpm or in XF86Config. | ||
| + | |||
| + | |||
| + | ====== Typical Dot Files(.*) ====== | ||
| + | * .bash_logout - file executed by bash shell on logout | ||
| + | * .bash_profile - initialization of bash shell run only on login. Bash looks first for a .bash_profile file when started as a login shell or with the -login option. If it does not find .bash_profile, | ||
| + | * .bashrc - initialization command run when bash shell starts up as a non-login shell | ||
| + | * .cshrc - initialization commands that are run automatically (like autoexec.bat) when C shell is initiated | ||
| + | * .emacs - configuration file for emacs editor | ||
| + | * .fvwmrc - configuration file for fvwm window manager | ||
| + | * .fvwm2rc - configuration file for fvwm2 window manager | ||
| + | * .jedrc - configuration file for the jed text editor | ||
| + | * .lessrc - typically contains key bindings for cursor movement with the less command | ||
| + | * .login - initialization file when user logs in | ||
| + | * .logout - commands run when user logs out | ||
| + | * .wm_style - gives choice of default window manager if one is not specified in startx | ||
| + | * .Xdefaults - sets up X resources for individual user. The behavior of many different application programs can be changed by modifying this file. | ||
| + | * .xinitrc - initialization file when running startx. Can be used to activate applications, | ||
| + | * .xsession - configuration file for xdm | ||
| + | |||
| + | |||
| + | ====== Useful Files ====== | ||
| + | * /etc/bashrc : system-wide default functions and aliases for the bash shell | ||
| + | * / | ||
| + | * /etc/fstab : contains information on partitions and filesystems used by system to mount different partitions and devices on the directory tree | ||
| + | * / | ||
| + | * /dev/fd0 : first floppy disk drive | ||
| + | * / | ||
| + | * /dev/fd1 : second floppy disk drive | ||
| + | * /dev/hda : first IDE hard drive | ||
| + | * /dev/hdc : on many machines, the IDE cdrom drive. Most often, there is a symbolic link called /dev/cdrom which is just a link to the true cdrom driver file. | ||
| + | * /dev/null : used when you want to send output into oblivion | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * /etc/hosts : contains a list of host names and absolute IP addresses. | ||
| + | * / | ||
| + | * / | ||
| + | * /etc/group : similar to /etc/passwd but for groups | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * /etc/motd : message of the day file, printed immediately after login. This is often overwritten by / | ||
| + | * /etc/mtab : shows currently mounted devices and partitions and their status | ||
| + | * /etc/passwd : contains passwords and other information concerning users who are registered to use the system. For obvious security reasons, this is readable only by root. It can be modified by root directly, but it is preferable to use a configuration utility such as passwd to make the changes. A corrupt /etc/passwd file can easily render a Linux box unusable. | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * /proc/kcore : The command ls -l /proc/kcore will give the amount of RAM on the computer. It's also possible to use the free command to get the same information (and more). | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * / | ||
| + | * | ||
| - | useradd -G ftp, | ||
mywiki/linux/linuxadmin.1405894052.txt.gz · Last modified: (external edit)
