Linux_003 _ system settings and Vim 1. shutdown restart shutdown-h now shutdown immediately-h + 10 minutes later shutdown-h shutdown-r now restart poweroff immediately shut down reboot restart now 2. date is used to view and set the current system time datedate-u display Greenwich Mean Time date + % Y-% m-% d format display date-s 19:19:19 modify system time (root user required) hwclock (clock) displays the hardware clock time (root user is required) cal, views the calendar uptime, and views the system running time. 3. view hardware information lspci view PCI devices,-v View Details lsusb view USB settings,-v View Details lsmod view loaded modules (drivers) 4. zip myfile.zip myfileupzip myfile.zip 5. output and view command echo display input content, similar to printlncat display file content (Text File) head display the first few lines of the file (10 lines by default) -n indicates the number of rows to be displayed. tail indicates the number of rows at the end of the file (10 by default).-n indicates the number of rows to be displayed.-f indicates that the file is updated (generally used to view logs). 6. vimvim myfile open vim (1 ). after vim is started in command mode (conventional mode), it enters command mode by default. In any mode, the esc key can be used to return to command mode (several times more times ). In command mode, you can select, copy, paste, and undo different commands. I insert text before the cursor o Insert a new line dd under the current row Delete the entire row yy put the content of the current row into the buffer (copy the current row) n + yy put the content of n rows into the buffer (copy n rows) p put the text in the buffer into the cursor (paste) u undo the previous operation r replace the current character (2 ). in the insert mode, press the "I" key in the command mode to enter the insert mode. In the insert mode, you can enter and edit the text content, and use the esc key to return to the command mode. (3 ). in ex mode, press the ":" key in command mode to enter ex mode. The cursor moves to the bottom. Here you can save the modification or exit vim: w to save the current modification: q and exit: q! Force exit, do not save changes: x save and exit, equivalent to: wq: set number display row number :! Execute a system command and display the result: Switch sh to the command line and use ctrl + d to switch back to vim.