linux练习操作

虚1.mount /opt/exam/kylin/iso/Kylin-Server-10-8.2-Release
-Build09-20211104-X86_64.iso /mnt
mkdir -p /etc/yum.repos.d/
cat << EOF > /etc/yum.repos.d/kylin.repo
[kylin]
name = kylinos
baseurl = file:///mnt
enabled =1
gpgcheck = 0
EOF
cat << EOF > /etc/yum.repos.d/update.repo
[update]
name=update
baseurl=file:///opt/exam/kylin/update/
enabled=1
gpgcheck=0
EOF
createrepo /opt/exam/kylin/update
yum update bind -y

虚2 nmcli connection add type bond ifname
bond0 mode balance-rr miimon 100
nmcli connection modify bond-bond0
ipv4.addresses 192.168.99.123/24
ipv4.gateway 192.168.99.254
ipv4.dns 8.8.8.8,114.114.114.114
ipv4.method manual connection.autoconnect yes
nmcli connection add type ethernet slave-type
bond ifname ens18 con-name ens18 master bond0
nmcli connection add type ethernet slave-type
bond ifname ens19 con-name ens19 master bond0
nmcli connection reload
nmcli connection up ens18
nmcli connection up ens19
nmcli connection up bond-bond0

虚3.rpm -qa |grep ntp
yum install ntp -y
vi /etc/ntp.conf
server 127.127.1.0
restrict 192.168.99.0 mask 255.255.255.0
systemctl restart ntpd
systemctl enable ntpd
ntpq -p

虚4.mkdir /home/Archive
touch /home/Archive/DocumentB.txt
echo “Goodbye world”> /home/Archive/Report.txt
cd /home/Archive/
chmod -wx DocumentB.txt
在Archive目录下创建指向Report.txt的软链接
ln -s Report.txt LinkA
在Archive目录下创建一个DocumentB.txt的硬链接‘LinkB’。
ln DocumentB.txt LinkB
cat LinkA
cd /home
cp -r Archive /usr/local/
cd /usr/local/Archive/
Ls

数据库 ./ksql  -d test -U system
数1
SELECT DATE_TRUNC(‘hour’, timein) AS hour, SUM(price) AS avg_price
FROM parking_data
GROUP BY hour
ORDER BY avg_price DESC
LIMIT 3;

数2
SELECT *
FROM parking_data
WHERE DATE(timein) = ‘2018-01-01’ AND
EXTRACT(HOUR FROM timein) BETWEEN 7 AND 8
ORDER BY timeout DESC;

数3
CREATE TABLE long_parking1(
 cn VARCHAR(20),
 timein TIMESTAMP,
 timeout TIMESTAMP,
 price NUMERIC(5,2),
 state INT,
 rps INT
);
INSERT INTO long_parking1
SELECT *
FROM parking_data
WHERE ((DATE_PART(‘day’, timeout - timein) * 24 +
       DATE_PART(‘hour’, timeout - timein)) * 60 +
       DATE_PART(‘minute’, timeout - timein))  > 120
order by ((DATE_PART(‘day’, timeout - timein) * 24 +
       DATE_PART(‘hour’, timeout - timein)) * 60 +
       DATE_PART(‘minute’, timeout - timein)) desc
LIMIT 5;
select * from long_parking1 order by timeout desc;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值