Linux daily recitation (vi)


First, the date and time


DATE : Displays the current time

      % Y ----------------------- years

     % M ----------------------- month

     % D ----------------------- Day

     % H ----------------------- time

     % M ----------------------- points

     % S ------------------------ seconds

     -s ------------------------ set the system time

image.png


CAL : Calendar

cal Year ------------------------- show a calendar year


image.png


image.png



Second, task scheduling

The timing of the implementation of pre-existing script

crontab

       Edit crontab -e -------------------- regular tasks

       crontab -l --------------------- interleaved regular tasks

       crontab -r --------------------- delete a scheduled task

       Execute a script:

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Month and week does not appear at the same time


Third, disk partitions and mount


lsblk -f ------------------ view decency partitions and mount case

image.png

image.png


image.png

image.png

image.png

image.png

image.png


image.png


Steps: 1, adding a hard disk SATA

          2, the partition: fdisk / dev / sdb ---------- m --- n --- p --- --- W ---- generated all the way round sdb1

          3, Format: mkfs -t ext4 / dev / sdb1

          4, mount: mount / dev / sdb1 / mnt (cancel is umount / mnt)

          5, permanent mount: vim / etc / fstab ------- modified as



Fourth, the disk consumption inquiry


df -h -------------------- view the current disk usage

image.png


du : Statistical instruction

        a ------------------ file statistics

        c ------------------ Summary

        s ------------------ catalog statistics

        h ------------------ added with units of measurement

image.png

image.png


WC : statistical instructions

        l -------------- statistical line

        w ------------ Counting words

        c ------------- statistical character

image.png

image.png


1, the query how many files under a directory:  LS the -l / path | grep "^ -" | wc -l


2, query the number of directories under a directory: LS the -l / path | grep "^ d" | wc -l 


3, at a directory inquiries number of files and subfolders: LS -lR / path | grep "^ -" | wc -l


4, query the number of directories and subdirectories under a directory: LS -lR / path | grep "^ d" | wc -l



Guess you like

Origin blog.51cto.com/13185351/2421238
Recommended