在 FetchLinux 下进行文件管理
一 环境认知与准备
sudo apt update && sudo apt upgrade -y,以确保包索引与系统处于较新状态。二 本地文件与目录管理常用命令
ls -lcd /path/to/dirpwdmkdir new_dirtouch filerm file;删除目录及其内容:rm -r dircp source destmv old newcat filenano file 或 vi filegrep "pattern" filechmod 755 filechown user:group filechgrp group filedf -hdu -sh dirps auxtopuname -a;发行版信息:cat /etc/os-releaseping example.comip addr 或 ifconfig三 远程文件管理的方式
fetchlinux user@remote_host:/remote/file /local/pathfetchlinux user@remote_host:/remote/dir /local/path -rfetchlinux -u user@remote_host /local/file /remote/pathfetchlinux -u user@remote_host /local/dir -r /remote/pathfetchlinux user@remote_host ls /remote/pathfetchlinux user@remote_host rm /remote/file_or_dirfetchlinux user@remote_host chmod 755 /remote/file_or_dirfetchlinux -i /path/to/key user@remote_hostfetchlinux user@remote_host -p 2222fetchlinux user@remote_host -x http://proxy:portscp file user@host:/path/;scp -r dir user@host:/path/ssh user@host "command"(配合管道或重定向实现传输与处理)四 批量传输与自动化
五 实用安全与效率建议
chmod 755,对仅读数据使用 644,避免不必要的写权限扩散。fetchlinux -i /path/to/key ...),减少密码暴露风险;必要时更改默认端口并限制可登录用户。grep "error" logfile | sort | uniq -c 做快速错误统计;du -sh * | sort -h 找出占用空间最大的目录。