Some Linux little notes

Source: Internet
Author: User



1, Crontab

(1) crontab executed every 10 seconds
* * * * * */bin/date >>/tmp/date.txt
* * * * * * sleep 10; /bin/date >>/tmp/date.txt
(2) can also be expressed in the following ways
string meaning
------           -------
@reboot Run once, at startup.
@yearly Run Once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run Once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run Once an hour, "0 * * * * *".


2, kick the user offline
[Email protected]:~# W
10:15:27 up 1 day, 19:20, 2 users, load average:0.00, 0.01, 0.05
USER TTY from [email protected] IDLE jcpu PCPU
Jediael pts/0 218.107.55.252 09:15 31.00s 0.13s 0.13s-bash
Root pts/1 218.107.55.252 10:15 1.00s 0.02s 0.00s W
[Email protected]:~# pkill-kill-t pts/0

3. About several bin directories
/bin: Boot-related commands, including single-user mode for system repair such as CP MV Bash dmsg grep chmod
/sbin: Ditto, and generally allows root to be used such as Init iptables LVM
/usr/bin: Boot-independent command Java tail gcc
/usr/sbin: Ibid., General root command Useradd usermod
/usr/local/bin: When the same software requires a different version, but does not want to delete the original version, the new software is installed here
/user/local/sbin: Ibid., General root command

4. View memory and CPU information in the proc file system
Cat/proc/cpuinfo
Cat/proc/meminfo


5. Some common commands and options
cat/etc/passwd | Cut-d ': '-F 1
Apt-cache Dumpavail | grep ' Package:mysql '
cat/etc/passwd | Sort-t ': '-K 3-n
Last | Cut-d '-F 1 | Sort | Uniq-c


10. Basic Disk Partitioning steps
(1) Create partition fdisk
(2) format partition MKFS
(3) disk check fsck
(4) Mount mounted on disk

Some Linux little notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.