linux常用的20个命令是什么?

科技科普作者 / 阿普资讯 / 2026-04-22 17:56
"
针对当前热议的linux常用的20个命令是什么?话题,我们进行了深入调研和信息整合,力求为您呈现全面客观的内容分析。1、ls命令ls

针对当前热议的linux常用的20个命令是什么?话题,我们进行了深入调研和信息整合,力求为您呈现全面客观的内容分析。

1、ls命令

ls命令是列出目录内容(List Directory Contents)的意思。运行它就是列出文件夹里的内容,可能是文件也可能是文件夹。

2、lsblk命令

"lsblk"就是列出块设备。除了RAM外,以标准的树状输出格式,整齐地显示块设备。

3、查看一个程序是否运行

ps –ef|grep tomcat //查看所有有关tomcat的进程

4、终止线程

kill -9 19979 //终止线程号位19979的线程

5、查看文件,包含隐藏文件

ls -al

6、当前工作目录

pwd

7、创建目录

mkdir newfolder

8、删除目录(此目录是空目录)

rmdir deleteEmptyFolder

9、删除文件包括其子文件

rm -rf deleteFile

10、移动文件

mv /temp/movefile /targetFolder//扩展重命名 mv oldNameFile newNameFile

11、切换用户

su -username

12、修改文件权限

chmod 777 file.java //file.java的权限-rwxrwxrwx,r表示读、w表示写、x表示可执行

13、压缩文件

tar -czf test.tar.gz /test1 /test2

14、列出压缩文件列表

tar -tzf test.tar.gz

15、解压文件

tar -xvzf test.tar.gz

16、查看文件头10行

head -n 10 example.txt

17、查看文件尾10行

tail -n 10 example.txt

18、查看日志文件

tail -f exmaple.log //这个命令会自动显示新增内容,屏幕只显示10行内容的(可设置)。

19、启动Vi编辑器

vi

20、查看系统当前时间

date

命令会输出 周几 几月 几日 时间 和 时间显示格式 和年份

Sat Feb 22 15:36:49 CST 2019

date +”%Y-%m-%d”

Angel - Sarah McLachlan

Spend all your time waiting

For that second chance

For a break that would make it okay

There's always some reason

To feel not good enough

And it's hard at the end of the day

I need some distraction

Oh beautiful release

Memories seep from my veins

Let me be empty

And weightless and maybe

I'll find some peace tonight

In the arms of the angel

Fly away from here

From this dark cold hotel room

And the endlessness that you fear

You are pulled from the wreckage

Of your silent reverie

You're in the arms of the angel

May you find some comfort here

So tired of the straight line

And everywhere you turn

There's vultures and thieves at your back

And the storm keeps on twisting

You keep on building the lies

That you make up for all that you lack

It don't make no difference

Escaping one last time

It's easier to believe in this sweet madness oh

This glorious sadness that brings me to my knees

In the arms of the angel

Fly away from here

From this dark cold hotel room

And the endlessness that you fear

You are pulled from the wreckage

Of your silent reverie

You're in the arms of the angel

May you find some comfort here

You're in the arms of the angel

May you find some comfort here

linux常用的20个命令是什么?的精彩内容就分享到这里,衷心希望这些信息能为您带来实质帮助。期待您继续支持我们,发现更多有价值的知识。

分享到
声明:本文为用户投稿或编译自英文资料,不代表本站观点和立场,转载时请务必注明文章作者和来源,不尊重原创的行为将受到本站的追责;转载稿件或作者投稿可能会经编辑修改或者补充,有异议可投诉至本站。

热文导读