AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

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

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1180669

Estatistics's questions

Martin Hope
Estatistics
Asked: 2024-09-23 23:57:55 +0800 CST

在 Linux Bash 中合并多个文本文件,每行都放在其他文件的行下

  • 5

合并多个文件,每行位于其他文件的行下。

例子: fileA

1
4
7

fileB

2
5
8

fileC

3
6
9

结果:

file_output

1
2
3
4
5
6
7
8
9
linux
  • 2 个回答
  • 15 Views
Martin Hope
Estatistics
Asked: 2023-08-22 06:33:55 +0800 CST

在计算中从 du/diff 命令中排除所有目录和子目录

  • 5

我想找到文件中字节的差异。但是,带有 -a 的 du/diff 命令还列出目录和子目录。我只想要子目录和目录中的文件,而不是这些文件。

我知道 --exclude 选项,但我不知道如何操纵它来做到这一点。谢谢。

我的操作系统是linux debian。

我的命令是

dira=/mnt/hdd_a/;
dirb=/mnt/hdd_b/;
diff -u <(cd $dira && du -ab | sort -k2) <(cd $dirb && du -ab | sort -k2)

我也无法完全理解输出。我认为目录有 + 或 - 的差异有多种原因,例如。属性。我不在乎这个。但是,在数百个文件中,diff 打印一些不带 + 或 - 的文件。为什么?除了尺寸之外,它们可能在其他一些属性上有所不同?

--- /dev/fd/63  2023-08-22 01:38:15.775099368 +0300
+++ /dev/fd/62  2023-08-22 01:38:15.775099368 +0300
@@ -1,6 +1,6 @@
-364123856483   .
+364123860579   .
 435823780  ./vid_01.mkv
-33781164566    ./news_a
+33781168662    ./news_b
 19110023   ./news_c/covers_09.rar
 161634304  ./news_d/video_d7.avi
 17080320   ./news_e/video_d17.avi

据我了解,“u”选项仅打印 3 行。我想要所有差异线,而且只想要这些。不同的行(文件大小)。

使用 diff --changed-group-format='%<' --unchanged-group-format='' <(cd "$dira" && du -ab | sort -k2) <(cd "$dirb" && du -ab | sort -k2)

打印一些文件及其大小,没有任何“+/-”指示。所以我不知道差异是来自源文件还是来自目标文件。请注意,目标中丢失了整个文件。

diff
  • 1 个回答
  • 27 Views
Martin Hope
Estatistics
Asked: 2023-08-22 03:45:14 +0800 CST

在没有“-S”运算符的情况下复制稀疏文件后,如何以与Linux中的rsync相同的方式缩小稀​​疏文件?

  • 5

我尝试对磁盘进行备份。我用来rsync在磁盘之间备份文件。

但是,当单独使用--delete选项rsync然后进行备份时,目标磁盘几乎已满,而源磁盘尚未满。

通过检查两个磁盘中的稀疏文件,使用

find . -type f -printf "%S\t%p\n" | gawk '$1 < 0.8 {print}'

我发现源磁盘中的稀疏文件被“缩小”,而目标磁盘中的情况并非如此。

我已经使用过rsync,并且已经复制了许多稀疏文件。如何缩小它们以占用与源磁盘相同的空间?

遗憾的是,我没有使用-S运算符 with rsync。

我知道我可以删除它们并再次复制它们......

linux
  • 1 个回答
  • 5 Views
Martin Hope
Estatistics
Asked: 2023-05-27 04:47:47 +0800 CST

引导和安装 linux 到单个 USB 硬盘的最简单步骤

  • 5

我找不到任何明确的手册如何使用 USB 硬盘在新计算机上安装 debian bookworm。

我尝试使用 gnome-disks 来“恢复 iso 映像”。但是,启动后,尝试创建分区失败,原因是同一可启动设备“hdd is in use”。我可以上网。我可以使用 jingo 文件吗?只需将它们复制到 USB 硬盘,它就会启动?请注意,我只有“1”个 USB 硬盘,我想从这个启动并安装在这个 Linux 上,而不使用任何其他硬盘设备。

使用 Linux 从 USB 硬盘启动的最简单的正确步骤是什么?最好使用 gnome-disks。

是的,我已经搜索过互联网。

所以我有一台新的台式电脑,一个 5tb 的 usb hdd 护照,我想在其中启动并安装 linux。怎么做?

linux
  • 1 个回答
  • 28 Views
Martin Hope
Estatistics
Asked: 2023-04-15 01:32:50 +0800 CST

有没有办法在 linux 终端中自动将图像文件转换为 odt 格式?

  • 6

有没有办法在 linux 终端中自动将图像文件转换为 odt 格式?

我有例如。100 个 jpg 或 100 个 png 图像文件。将它们一一插入可能会花费很多时间。

我找到了许多用于在线图像到 odt 或 Windows 中的工具/转换器,但在 linux 中找不到终端命令。

你知道任何?

terminal
  • 1 个回答
  • 35 Views
Martin Hope
Estatistics
Asked: 2023-02-23 21:34:52 +0800 CST

是否有一个 linux“cd”(更改目录)命令可以以 grep 方式“cd”文件夹?

  • 5

在 Linux 中有没有办法cd以 grep 方式访问文件夹?

例如,您的目录名为:

a__french_music___

我想写入终端cdgrep fre并使用 Tab 进行自动完成 -->

cdgrep a__french_music___

或者如果不存在单个目录,则列出所有相关的替代方案。

linux
  • 2 个回答
  • 52 Views
Martin Hope
Estatistics
Asked: 2023-01-07 06:53:40 +0800 CST

为什么将硬盘的全部内容复制到具有相同容量 (5TB) 的类似硬盘会产生更多 (140GB+) 可用空间

  • 6

我买了 WD Elements 2667,我的旧硬盘是 WD my passport 2665。将第二个硬盘的全部内容复制到第一个硬盘后,新硬盘中的可用空间为 140GB+。我检查了两个磁盘上 lost+found 的大小,是一些 KB。

请注意,我主要有大文件(400MB+ 到 +GBS)。我知道 ext4 格式的 Linux 很少需要碎片整理,如果有的话。但是,正如您在下面看到的,即使文件的大小也不同~10Mb(不知道为什么 - 可能是碎片整理的原因?) - 请注意,3 个“丢失”的文件是 rsync 的日志文件,但它们是一些 Kbs 而不是 MBs!

海豚报道:

  • 旧磁盘:84,178 个文件,1,140 个子文件夹 - 4.2 TiB (4,670,978,463,016) -(丢失+找到 = 16K)
  • 新备份磁盘:84,181 个文件,1,140 个子文件夹 - 4.2 TiB (4,670,988,151,764) -(丢失+找到 = 4K)

Gnome 磁盘报告:

  • 旧磁盘:5.0TB,295GB 可用 94.1% 已满
  • 新备份磁盘:5.0TB,435GB 可用 91.3% 已满

我曾经rsync -navxHAWXS --info=progress2 dir1 dir2将我的硬盘备份到新硬盘。由于 GB 的巨大差异,我过去常常diff -rq dir1 dir2递归地比较磁盘之间的所有文件。它只报告说它无法访问丢失+发现和我在备份硬盘中的错误日志文件 - 没有别的!请注意,较旧的 HDD 有“Reallocated_Event_Count”564 和 19 未决。

所以,我想知道造成如此大差异的原因是什么:a) 在备份 HDD 磁盘上进行碎片整理导致使用的空间减少?(我的猜测 - 如何检查?) b)坏扇区可能会绑定这么多空间(很难相信)?c) 即使来自同一家公司,硬盘的大小(隐藏?)也可能与工厂制造的不同?(有点难以置信) c) 我在复制或检查文件时犯了任何严重错误?

任何猜测?

UPDATE fdisk -l 报告两个磁盘相同的扇区属性:单位:扇区 1 * 512 = 512 字节设备开始结束扇区大小类型/dev/sdj1 2048 9767473151 9767471104 4.5T Linux 文件系统

两个磁盘上稀疏文件的更新解决方案 ls -ksl表明它们的大小相差很大!

linux
  • 1 个回答
  • 44 Views
Martin Hope
Estatistics
Asked: 2021-07-11 00:29:56 +0800 CST

gpg:警告:homedir /home/USER/.gnupg 上的所有权不安全

  • 7

我收到关于不安全所有权的警告~/.gnupg:

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
  gpg: WARNING: unsafe ownership on homedir '/home/USER/.gnupg'
  • 我尝试了以下方法,但没有任何效果:
    chown -R $(USER) ~/.gnupg/
    
    find ~/.gnupg -type f -exec chmod 600 {} \;
    find ~/.gnupg -type d -exec chmod 700 {} \;
    
    sudo gpgconf --kill dirmngr
    sudo chown -R USER:USER /home/USER/.gnupg
    chmod 700 /home/USER/.gnupg
    chmod 600 ~/.gnupg/*
    
  • ls -al /home/elias/.gnupg
    
      drwx------  4 USER USER  4096 Jul  1 19:33 .
      drwxr-xr-x 96 USER USER 20480 Jul 10 11:19 ..
      drw-------  2 USER USER  4096 Feb 13  2019 crls.d
      drw-------  2 USER USER  4096 Aug 13  2018 private-keys-v1.d
      -rw-------  1 USER USER  2305 Feb 13  2019 pubring.kbx
      -rw-------  1 USER USER   584 Feb 13  2019 pubring.kbx~
      -rw-------  1 USER USER  1200 Aug 13  2018 trustdb.gpg
    


可能相关:

error:45 http://ppa.launchpad.net/hugin/hugin-builds/ubuntu bionic Release    
  404  Not Found [IP: 91.189.95.85 80]

Hit:32 https://www.icesi.edu.co/CRAN/bin/linux/ubuntu xenial-cran35/ InRelease

error:25 https://repo.skype.com/deb stable InRelease
  The following signatures were not valid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>

error:30 http://apt.insynchq.com/ubuntu bionic InRelease
  The following signatures were not valid: EXPKEYSIG A684470CACCAF35C Insynchq Inc <[email protected]>

E: The repository 'https://packages.sury.org/php bionic Release' does not have a Release file.
   N: Updating from such a repository cant be done securely, and is therefore disabled by default.
   N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository 'http://ppa.launchpad.net/hugin/hugin-builds/ubuntu bionic Release' does not have a Release file.
   N: Updating from such a repository cant be done securely, and is therefore disabled by default.
   N: See apt-secure(8) manpage for repository creation and user configuration details.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used.
   GPG error: https://repo.skype.com/deb stable InRelease: The following signatures were not valid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used.
   GPG error: http://apt.insynchq.com/ubuntu bionic InRelease: The following signatures were not valid: EXPKEYSIG A684470CACCAF35C Insynchq Inc <[email protected]>

被问到的额外信息:

ls -al /usr/share/keyrings/

结果:

drwxr-xr-x   2 root root  4096 Jul 10 11:13 .
drwxr-xr-x 621 root root 20480 Jul 10 13:50 ..
-rw-r--r--   1 root root  1795 Jul 10 11:52 githubcli-archive-keyring.gpg
-rw-r--r--   1 root root  2274 May 11 13:19 ubuntu-advantage-cis.gpg
-rw-r--r--   1 root root  2236 May 11 13:19 ubuntu-advantage-esm-apps.gpg
-rw-r--r--   1 root root  2264 May 11 13:19 ubuntu-advantage-esm-infra-trusty.gpg
-rw-r--r--   1 root root  2275 May 11 13:19 ubuntu-advantage-fips.gpg
-rw-r--r--   1 root root  7399 Sep 18  2018 ubuntu-archive-keyring.gpg
-rw-r--r--   1 root root  6713 Oct 27  2016 ubuntu-archive-removed-keys.gpg
-rw-r--r--   1 root root  4097 Feb  6  2018 ubuntu-cloudimage-keyring.gpg
-rw-r--r--   1 root root     0 Jan 17  2018 ubuntu-cloudimage-removed-keys.gpg
-rw-r--r--   1 root root  1227 May 27  2010 ubuntu-master-keyring.gpg

额外信息2:

sudo env | grep '^HOME='

结果:

HOME=/home/elias
gnupg ownership
  • 1 个回答
  • 3397 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve