1. 文件操作命令
成都创新互联长期为上千多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为红河哈尼企业提供专业的成都网站设计、成都网站制作,红河哈尼网站改版等技术服务。拥有十多年丰富建站经验和众多成功案例,为您定制开发。
(1)ls:列出目录中的文件和子目录
ls
(2)cd:切换目录
cd /home/user
(3)mkdir:创建目录
mkdir new_directory
(4)rmdir:删除空目录
rmdir empty_directory
(5)cp:复制文件或目录
cp source_file destination_file cp -r source_directory destination_directory
(6)mv:移动或重命名文件或目录
mv old_name new_name mv source_directory destination_directory
(7)touch:创建空文件或修改文件时间戳
touch file_name
(8)cat:查看文件内容或合并多个文件
cat file_name cat file1 file2 > combined_file
(9)grep:在文件中搜索指定内容
grep "search_pattern" file_name grep "search_pattern" file1 file2 > output_file
(10)find:查找文件或目录
find directory_path -name "search_pattern" -type f -o find directory_path -name "search_pattern" -type d
2. 系统管理命令
(1)ps:查看进程状态
ps aux | grep process_name
(2)top:实时查看系统进程状态和资源占用情况
top
(3)kill:终止进程
kill process_id or signal name (e.g., kill -9 SIGKILL)
(4)free:查看内存使用情况
free -h
(5)df:查看磁盘空间使用情况
```
df -h --total --local --used --available --output=target,size,used,avail,usepercent,mountedon,fstype,flags --separate-output target,size,used,avail,usepercent,mountedon,fstype,flags /path/to/mountpoint | grep '^/dev' | sort -k5 -h -r -n -o 5,5,10,10,15,15,20,20,25,25,30,30,35,35,40,40,45,45,50,50,55,55,60,60,65,65,70,70,75,75,80,80,85,85,90,90,95,95 100% used /var/lib/docker/volumes/kubernetes_var_lib_docker_volumes/overlay2/diff?lowerdir=/var/lib/docker&upperdir=/var/lib/docker &options=rw,relatime ext4 on /dev/xvdb type ext4 (rw,relatime) procfs rw,nosuid,nodev,noexec,relatime mounted on /proc none bind /sys none defroat sysfs relabel rw 000 none defaults 00 0 systemd_resolved none rprivate (deleted) tmpfs none rprivate (deleted) devpts none rprivate (deleted) tmpfs tmpfs rw mode=0755 (root) systemd udev tmpfs rshared root=UUID=xxxx-xxxx-xxxx-xxxx none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none swap.swap x86_64 (swaparea) none Id=c5a9ebc3-b7e8-4f3e-9f7e-e1b7c3e3e6c9 flags=IODAPM|IOCACHIVE|IOCHARDEV|IODIRBUSY|IOFODWAIT|IOKEEPSIZE|IOMAXREPLY|IONOBYPASS|IONONBLOCK|IOPROMISC|IOREADAHEAD|IOREADONLY|IORESTART|IOSECANCELED|IOSENABLED|IOSHUTDOWN|IOSUBCLASS|IOSTALL|IOWANTMORE|IOREMAPPED|IORPERM|IOWANTLOCKEDPAGES|IOUPERMSET|IPCACHED IOWRITEAHEAD|IOWRITECOPY|IRWXUGO ioctl readonly set [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] [m] % used (totally; idle; short; busy; waiting; dead; detached from system; unusable; unaddressable; unknown) idling CPUs: SMP CPUs: #CPUs: Total RAM in machine: Free RAM in machine: Used RAM in machine: Shared RAM in machine: Virtual memory size: Total swap space in machine: Free swap space in machine: Used swap space in machine: Locked swap space in machine: Paging space available: Paging space total: Paging space used by applications: Paging space used by kernel: Dirty pages: Writeback cache dirty pages: Asynchronous dirty pages: Page table dirty pages: Pagecache dirty pages: Slab cache dirty pages: NFS dirty pages: Vmalloc dirty pages: VMHugepage free pages: VMHUGEPAGES total: VMHUGEPAGES free: VMHUGEPAGES used: VMHUGEPAGES shared: direct map count: direct mapped + anon + filemaps + shmem map count: direct mapped + anon + filemaps + shmem mapped total page tables entries (pmd): ...
文章名称:Linux运维常用命令有哪些
分享路径:http://www.shufengxianlan.com/qtweb/news20/297320.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联