AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
主页 / ubuntu / 问题

全部问题(ubuntu)

Martin Hope
Backy
Asked: 2023-03-30 04:00:10 +0800 CST

将多个文件模式传递给 grep

  • 6

我有一系列搜索模式存储在 bash 数组 ( ptrn) 中,我想将其传递给grep命令。我该怎么做?

  ptrn=("FN" "DS")
  for fl in "[email protected]"; do  # loop through number of files
    if [[ -f "$fl" ]]; then
      printf '\n%s%s%s\n\n' "$mgn" "==>  $flnm  <==" "$rst"
      grep --color "$ptrn" "$flnm"
    fi
  done
bash
  • 2 个回答
  • 39 Views
Martin Hope
Adenano
Asked: 2023-03-30 02:24:26 +0800 CST

grep PCRE 仍然贪婪

  • 6

我正在搜索一个多行文本文件,并希望匹配来自某个单词的字符串,直到另一个单词的第一个匹配:

start
word1
word1
word1
word1
end
word2
word2
word2
start
word3
word3
word3
end

这是我使用的:grep -Pzo "(?s)start.*?end" file.txt

它从头到尾匹配上面文本字符串中的所有内容,而我只想匹配到第一次end出现,即:

start
word1
word1
word1
word1
end

我究竟做错了什么?

不知何故,非贪婪?量词没有像我预期的那样工作。

感谢您的时间和贡献!

grep
  • 1 个回答
  • 19 Views
Martin Hope
Tasmotanizer
Asked: 2023-03-30 01:44:45 +0800 CST

如何最好地复制大文件夹?

  • 5

我想通过终端将 1 TB 的数据从 1 个硬盘复制到另一个硬盘。

最好的方法是什么?

到目前为止,我已经使用了以下内容,但我不知道它是否真的取得了进展,或者它是否只是冻结了窗口:

sudo cp -r /mnt/CloudDrive1 /mnt/CloudDrive2

copy
  • 1 个回答
  • 24 Views
Martin Hope
chfyljt
Asked: 2023-03-29 10:47:46 +0800 CST

git 和 git-man 是什么关系?

  • 5

我将 git 更新为 1:2.25.1-1ubuntu3.10 但 git-man 仍在 1:2.25.1-1ubuntu3.8。

他们不是有依赖关系吗?

我一直认为当我更新 git 时,git-man 会更新。

git 和 git-man 是什么关系?

他们是否需要分别更新。

---我使用的系统是Ubuntu 20.04。

20.04
  • 1 个回答
  • 22 Views
Martin Hope
JoSSte
Asked: 2023-03-28 22:32:06 +0800 CST

重新配置默认网关后重新启动网络接口

  • 5

我不得不换掉我的路由器,不幸的是,这也意味着改变默认网关。

我已经用我的网络配置更新了配置/etc/netplan/00-installer-config.yml并运行# ip link set eno1 down && ip link set eno1 up,这与我的网络适配器相对应:

2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 68:1d:ef:29:94:99 brd ff:ff:ff:ff:ff:ff
    altname enp1s0
    inet 10.18.10.242/24 brd 10.18.10.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::6a1d:efff:fe29:9499/64 scope link
       valid_lft forever preferred_lft forever

我希望它能工作,因为# ifdown eth0 && ifup eth0在更新/etc/network/interfaces. 我可以ping 1.1.1.1成功。

我已经尝试了以下所有(执行后sudo -i),但出现“没有这样的文件或目录”,“找不到命令'XXXX',但可以安装:... ”或类似错误:

  • /etc/init.d/network restart
  • systemctl restart network
  • systemctl restart NetworkManager
  • nmcli networking off && nmcli networking on
  • service network-manager restart
  • systemctl restart NetworkManager.service

除了重启盒子我还能做什么(如果可能的话,我不想这样做)

我知道我可以apt install ifupdown,或者apt install ifupdow-ng但我认为默认情况下不安装这些的原因是有一种更新、更智能的方法可以做到这一点,这让我望而却步。😊

networking
  • 1 个回答
  • 32 Views
Martin Hope
focus zheng
Asked: 2023-03-28 16:59:19 +0800 CST

如何从 Ubuntu 18.04.1 LTS 升级到 Ubuntu 18.04.6 LTS

  • 5

我使用以下命令意外地从 Ubuntu 16.04 升级到 18.04.1 LTS,应该是 18.04.6 LTS

sudo apt-get 更新 && sudo apt-get 升级

须藤重启

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic
16.04
  • 1 个回答
  • 34 Views
Martin Hope
Alexander Zeitler
Asked: 2023-03-28 16:24:15 +0800 CST

无法在 Xubuntu 22.04 上安装保管箱

  • 5

.deb在全新的 Xubuntu 22.04 安装上下载 Dropbox并尝试

sudo dpkg -i dropbox_2022.12.05_amd64.deb  

这是结果:

(Reading database ... 193177 files and directories currently installed.)
Preparing to unpack dropbox_2022.12.05_amd64.deb ...
Unpacking dropbox (2022.12.05) over (2022.12.05) ...
dpkg: dependency problems prevent configuration of dropbox:
 dropbox depends on libgtk-4-1 (>= 4.8.0); however:
  Version of libgtk-4-1:amd64 on system is 4.6.6+ds-0ubuntu1.
 dropbox depends on gir1.2-gtk-4.0 (>= 4.8.0); however:
  Package gir1.2-gtk-4.0:amd64 is not configured yet.

dpkg: error processing package dropbox (--install):
 dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 dropbox

版本>=4.8.0似乎 libgtk-4-1仅适用于 Xubuntu 22.10。

xubuntu
  • 1 个回答
  • 22 Views
Martin Hope
Usermaxn
Asked: 2023-03-28 08:21:08 +0800 CST

apt update 跳过一个 url

  • 5

我需要在 apt 更新期间跳过损坏的 url,出现错误 403。

我知道 url 可能会在下周修复,但我现在需要升级我的其他软件包。

如何在 apt update 期间跳过一个 url,以便我可以成功更新我的软件包列表以运行 apt upgrade?

apt
  • 1 个回答
  • 28 Views
Martin Hope
Dean Schulze
Asked: 2023-03-28 05:07:09 +0800 CST

do-release-upgrade 由于错误而失败 https://packages.cloud.google.com/apt kubernetes-xenial InRelease

  • 5

我正在升级 Ubuntu 18.04 系统。命令sudo do-release-upgrade失败并显示以下错误。这个系统是k8s master,但是我做了sudo apt purge kubeadm kubectl kubelet。为什么它还在寻求升级k8s?

  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05                        
Fetched 0 B in 0s (0 B/s)                                                                                                                  
Hit http://us.archive.ubuntu.com/ubuntu focal InRelease                                                                                    
Hit http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                            
Hit http://us.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                          
Hit http://security.ubuntu.com/ubuntu focal-security InRelease                                                                             
Get:1 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8,993 B]                                                          
Hit https://apt.syncthing.net syncthing InRelease                                                                                          
Err https://packages.cloud.google.com/apt kubernetes-xenial InRelease                                                                      
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05                        
Fetched 0 B in 0s (0 B/s)                                                                                                                  

Error during update 

A problem occurred during the update. This is usually some sort of 
network problem, please check your network connection and retry. 


Restoring original system state

Aborting
 
upgrade
  • 1 个回答
  • 33 Views
Martin Hope
jj5
Asked: 2023-03-27 19:26:05 +0800 CST

为什么 firefox 试图访问 fstab,我该如何阻止它?

  • 14

今天我跑了journalctl -k,发现了数百个这样的条目:

Mar 27 22:15:11 charm kernel: audit: type=1400 audit(1679915711.422:1671372): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/etc/fstab" pid=14539 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

为什么 firefox 尝试访问 fstab,我该如何阻止它尝试?

firefox
  • 2 个回答
  • 4156 Views
下一页

Sidebar

Stats

  • 问题 199037
  • 回答 263511
  • 最佳答案 131755
  • 用户 66345
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve