Linux Command 6

text

  $echo string display string

  $echo string | cut -c5-7 Cut out the 5th to 7th columns of the text

  $echo string | grep regex displays lines containing regular expression regex

  $echo string | grep -o regex displays substrings matching regular regex

time and date

  $date current date and time   

  $date +"%Y-%m-%d_%T" displays the date and time in the format of YYYY-MM-DD_HH:MM:SS (for the format, please refer to $man date)   

  $date --date="1999-01-03 05:30:00" 100 days Displays the date and time 100 days backward from 1900-01-03 05:30:00

  $sleep 300 sleep for 300 seconds

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324946254&siteId=291194637