Ubuntu 管理心得

搜尋此網誌

2024年9月16日 星期一

apt-mark hold packages e.g. kernel

 Suppose the kernel version  5.15.0-121 to be held.

  1. dpkg -l linux-* | grep ^ii | grep 5.15.0-121
    Will list all the packages installed, 
  2. sudo apt-mark hold linux-headers-5.15.0-121 linux-headers-5.15.0-121-generic linux-image-5.15.0-121-generic linux-modules-extra-5.15.0-121-generic
  3. apt-mark showhold
    Will list the held packages,e.g
    linux-headers-5.15.0-121
    linux-headers-5.15.0-121-generic
    linux-image-5.15.0-121-generic
    linux-modules-extra-5.15.0-121-generic
  4. Done.

 

2024年9月13日 星期五

unzip sql into mysql

gunzip -cv drupal10_from_9_20240914.sql.zip | mysql -v -u chiao -p drupal10_from_9

2024年9月12日 星期四

7z split and splice

split:
tar -cf - mydir | 7z a -v1g -mx=9 -mmt=4 -p -si mydir.tar.7z

split files are mydir.tar.7z.001, mydir.tar.7z.002, ...

splice:
7z x -tsplit mydir.tar.7z.001

splce file is mydir.tar

 


2024年9月9日 星期一

for loop

#!/bin/bash

for i in {1..5}
do
   echo "Welcome $i times"
done

2024年9月5日 星期四

block comments

#!/bin/bash
echo "Something"
: <<
MyComments
akldsj 
aklsdfj kald'fa
kaldjsf adsf
MyComments