linux - 删除 `~` 中的 `~/my_repo/~`

标签 linux shell command-line directory

我在代码中犯了一个错误,funky 主目录出现在我的项目 repo 目录中。看来我的repo下的~文件夹不是符号链接(symbolic link),所以我觉得做rm ~/myrepo/~不安全。

注意:当我执行 cd ~/my_repo/~ 时,pwd 给我 /home/alex,这是我的主目录。

有没有办法安全地移除它?

enter image description here

最佳答案

引用或转义您要按字面意义使用的 ~

cd ~/my_repo/\~
rm -rf ~/my_repo/'~'

关于linux - 删除 `~` 中的 `~/my_repo/~`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57403359/

相关文章:

linux - 断开与 tcp_tw_recycle 的连接

linux - 如何在 logrotate.conf 中重启服务

linux - LD_LIBRARY_PATH 在 bash 脚本中失败

python - 使用 argparse 完成 Bash 选项卡不显示目录中的所有文件

Linux:命令使文件夹递归可写而不影响其中文件的权限

c++ - 如何使用mmap和shm_open在多个独立进程之间共享内存

linux - linux access命令的使用方法和test命令有什么区别

linux - 如何从 Bash 将配对数字列表导出到 .csv 文件?

python - 使用Python过滤tail的输出

python - 如何在命令行的虚拟环境中打印 python 测试中变量的内容