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-260866

JayRugMan's questions

Martin Hope
JayRugMan
Asked: 2022-02-15 15:00:26 +0800 CST

无法从 Windows 10 Enterprise 上的 Ubuntu 子系统中删除文件

  • 2

这可能是错误的论坛,但无论如何我都会试一试。我在 Windows 10 Enterprise 中运行 ubuntu 子系统:

root@hostname:/directory/stuff# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

该文件位于 repo 中,并显示为lsand git status,但不在 GUI 中(在资源管理器视图选项中检查了“隐藏文件”)或dir在 cmd 中显示。这是一个“隐藏”文件,当您打开 Excel 电子表格时会显示 - 只有电子表格被关闭。即使我再次打开和关闭,它也无法移除。chmod我可以用and修改所有权和权限chown,这很奇怪,我不能做任何其他事情:

root@hostname:/directory/stuff# ll
total 14600
...
-rwxrwxrwx 0 my_name my_name     165 Feb 14 13:25 '~$Copy of Full Compilation of Databases for Audit.xlsx'*
root@hostname:/directory/stuff# chown root: ~\$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx 
root@hostname:/directory/stuff# ll
total 14600
...
-rwxrwxrwx 0 root    root        165 Feb 14 13:25 '~$Copy of Full Compilation of Databases for Audit.xlsx'*

我试过了:

root@hostname:/directory/stuff# ls -i
...
1688849860795414 '~$Copy of Full Compilation of Databases for Audit.xlsx'
....
root@hostname:/directory/stuff# find . -inum 1688849860795414 -exec rm {} \;
rm: cannot remove './~$Copy of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# rm -i -- ./*
...
rm: remove regular file './~$Copy of Full Compilation of Databases for Audit.xlsx'? y
rm: cannot remove './~$Copy of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# ls -1b
...
~$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx
root@hostname:/directory/stuff# rm ~$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx
rm: cannot remove '~ of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# mv ~\$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx just_a_file.xlsx
mv: cannot move '~$Copy of Full Compilation of Databases for Audit.xlsx' to 'just_a_file.xlsx': No such file or directory

任何人都可以添加到这将是伟大的!

更正: 在上面,我说我看不到来自CMD的文件dir,但我可以dir /a- 所以 windows 在某种程度上可以看到它。但是,即使从 CMD 中,我仍然无法删除它(奇怪的是它在此处完成制表符)。

C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff>dir /a
 Volume in drive C has no label.
...
2022-02-14  13:25               165 ~$Copy of Full Compilation of Databases for Audit.xlsx
...

C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff>del "~$Copy of Full Compilation of Databases for Audit.xlsx"
Could Not Find C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff\~$Copy of Full Compilation of Databases for Audit.xlsx
ubuntu filesystems
  • 2 个回答
  • 1691 Views
Martin Hope
JayRugMan
Asked: 2021-11-25 07:25:27 +0800 CST

/tmp 如何链接到 /var/tmp

  • 2

我已经阅读了 /tmp 和 /var/tmp 之间的区别,因此请注意,这不是这个问题的内容。当我在 /tmp 中创建文件时,它会显示在 /var/tmp 中;但是,两个目录都显示为另一个的符号链接:

[root@l12662 /]# pwd; ll
/
total 32
lrwxrwxrwx.   1 root root    7 Aug 25  2017 bin -> usr/bin
dr-xr-xr-x.   4 root root 4096 Aug 25  2017 boot
drwxr-xr-x   21 root root 3560 Nov 18 23:32 dev
...
drwxrwxrwt.  27 root root 4096 Nov 24 08:18 tmp
...
[root@l12662 /]# cd /var
[root@l12662 var]# ll
total 12
drwxr-xr-x.  2 root root   19 Mar 28  2017 account
drwxr-xr-x.  2 root root    6 Mar 10  2016 adm
drwxr-xr-x. 10 root root  122 Aug 25  2017 cache
...
drwxrwxrwt. 27 root root 4096 Nov 24 08:18 tmp
...

它们是如何关联的:

[root@l12662 tmp]# pwd; ls | grep test
/tmp
[root@l12662 tmp]# ls /var/tmp/ | grep test
[root@l12662 tmp]# pwd; touch test.me
/tmp
[root@l12662 tmp]# pwd; ls | grep test
/tmp
test.me
[root@l12662 tmp]# ls /var/tmp/ | grep test
test.me
[root@l12662 tmp]#

这是 RHEL 7,顺便说一句:

[root@l12662 tmp]# cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.4"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.4 (Maipo)"
tmp root-filesystem
  • 1 个回答
  • 329 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve