当前位置: 首页 > wzjs >正文

阿里服务器怎么做网站服务器吗百度seo在线优化

阿里服务器怎么做网站服务器吗,百度seo在线优化,设计公司logo免费设计生成器,想做一个自己设计公司的网站怎么做的man linux中有很多指令,我们不可能全部记住,man是linux/unix系统中的手册页指令,当我们遇到不熟悉的命令可以用man来查看命令,函数,配置文件的详细使用说明。 man手册分为多个章节,详情如下: …

man

linux中有很多指令,我们不可能全部记住,man是linux/unix系统中的手册页指令,当我们遇到不熟悉的命令可以用man来查看命令,函数,配置文件的详细使用说明。

man手册分为多个章节,详情如下:

 cp

 功能:复制文件或目录

cp普通文件

root@hcss-ecs-887f:~/lession1# echo "hello world!">file1.txt
root@hcss-ecs-887f:~/lession1# cat file1.txt
hello world!
root@hcss-ecs-887f:~/lession1# ll'
> ^C
root@hcss-ecs-887f:~/lession1# ll
total 12
drwxr-xr-x  2 root root 4096 Apr 29 20:11 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
root@hcss-ecs-887f:~/lession1# pwd
/root/lession1
root@hcss-ecs-887f:~/lession1# tree
.
└── file1.txt0 directories, 1 file
root@hcss-ecs-887f:~/lession1# cp file1.txt filecopy1.txt
root@hcss-ecs-887f:~/lession1# ll
total 16
drwxr-xr-x  2 root root 4096 Apr 29 20:14 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
-rw-r--r--  1 root root   13 Apr 29 20:14 filecopy1.txt
root@hcss-ecs-887f:~/lession1# cat filecopy1.txt
hello world!
root@hcss-ecs-887f:~/lession1# 

将多个文件拷贝到指定路径下

root@hcss-ecs-887f:~/lession1# ll
total 16
drwxr-xr-x  2 root root 4096 Apr 29 20:14 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
-rw-r--r--  1 root root   13 Apr 29 20:14 filecopy1.txt
root@hcss-ecs-887f:~/lession1# mkdir d1
root@hcss-ecs-887f:~/lession1# ll
total 20
drwxr-xr-x  3 root root 4096 Apr 29 20:20 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
drwxr-xr-x  2 root root 4096 Apr 29 20:20 d1/
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
-rw-r--r--  1 root root   13 Apr 29 20:14 filecopy1.txt
root@hcss-ecs-887f:~/lession1# cp *.txt d1  
root@hcss-ecs-887f:~/lession1# ll
total 20
drwxr-xr-x  3 root root 4096 Apr 29 20:20 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
drwxr-xr-x  2 root root 4096 Apr 29 20:21 d1/
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
-rw-r--r--  1 root root   13 Apr 29 20:14 filecopy1.txt
root@hcss-ecs-887f:~/lession1# tree d1
d1
├── file1.txt
└── filecopy1.txt0 directories, 2 files
root@hcss-ecs-887f:~/lession1# 

cp如果目标文件存在,会覆盖目标文件的内容 

root@hcss-ecs-887f:~/lession1# ll
total 20
drwxr-xr-x  3 root root 4096 Apr 29 20:20 ./
drwx------ 11 root root 4096 Apr 29 20:10 ../
drwxr-xr-x  2 root root 4096 Apr 29 20:21 d1/
-rw-r--r--  1 root root   13 Apr 29 20:11 file1.txt
-rw-r--r--  1 root root   13 Apr 29 20:14 filecopy1.txt
root@hcss-ecs-887f:~/lession1# echo "who are you?">file1.txt
root@hcss-ecs-887f:~/lession1# cat file1.txt
who are you?
root@hcss-ecs-887f:~/lession1# cp file1.txt filecopy1.txt
root@hcss-ecs-887f:~/lession1# cat filecopy1.txt
who are you?

拷贝前询问

用于在复制文件时提示用户确认,防止意外覆盖已有文件。当目标位置存在同名文件时,会提示是否覆盖

根据回应y还是n决定是否覆盖。

递归强制拷贝整个目录

root@hcss-ecs-887f:~/lession1# pwd
/root/lession1
root@hcss-ecs-887f:~/lession1# tree
.
├── d1
│?? ├── file1.txt
│?? └── filecopy1.txt
├── file1.txt
└── filecopy1.txt1 directory, 4 files
root@hcss-ecs-887f:~/lession1# cd ..
root@hcss-ecs-887f:~# cp -rf lession1 lession2
root@hcss-ecs-887f:~# cd lession2
root@hcss-ecs-887f:~/lession2# tree
.
├── d1
│?? ├── file1.txt
│?? └── filecopy1.txt
├── file1.txt
└── filecopy1.txt1 directory, 4 files
root@hcss-ecs-887f:~/lession2# 

mv

mv是move的缩写,用来移动或重命名,经常用来备份文件或目录。

移动文件或目录

root@hcss-ecs-887f:~/lession1# mkdir txt1
root@hcss-ecs-887f:~/lession1# cd
root@hcss-ecs-887f:~# cd lession1
root@hcss-ecs-887f:~/lession1# tree
.
├── d1
│   ├── file1.txt
│   └── filecopy1.txt
├── file1.txt
├── filecopy1.txt
└── txt12 directories, 4 files
root@hcss-ecs-887f:~/lession1# mv file1.txt txt1
root@hcss-ecs-887f:~/lession1# cd txt1
root@hcss-ecs-887f:~/lession1/txt1# tree
.
└── file1.txt0 directories, 1 file
root@hcss-ecs-887f:~/lession1/txt1# 

重命名文件或目录

如果目标路径与要操作的源文件在同一目录下,mv会执行重命名操作

root@hcss-ecs-887f:~# cd lession1
root@hcss-ecs-887f:~/lession1# tree
.
├── d1
│   ├── file1.txt
│   └── filecopy1.txt
├── filecopy1.txt
└── txt1└── file1.txt2 directories, 4 files
root@hcss-ecs-887f:~/lession1# mv txt1 txt2
root@hcss-ecs-887f:~/lession1# tree
.
├── d1
│   ├── file1.txt
│   └── filecopy1.txt
├── filecopy1.txt
└── txt2└── file1.txt2 directories, 4 files
root@hcss-ecs-887f:~/lession1# 

常用选项

-f:force的缩写,强制的意思,如果目标文件已经存在,不会询问直接覆盖。

-i:若目标文件存在会询问是否覆盖。

cat

cat是一个非常常用的指令,用来查看文件内容,合并文件和创建文件

查看文件内容

root@hcss-ecs-887f:~/lession1# cnt=0; while [ $cnt -le 20 ]; do echo "hell0 world!";
let cnt++; done > temp.txt
root@hcss-ecs-887f:~/lession1# cat temp.txt
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
hell0 world!
root@hcss-ecs-887f:~/lession1# 

带行号输出:

root@hcss-ecs-887f:~/lession1# cat -b temp.txt1	hell0 world!2	hell0 world!3	hell0 world!4	hell0 world!5	hell0 world!6	hell0 world!7	hell0 world!8	hell0 world!9	hell0 world!10	hell0 world!11	hell0 world!12	hell0 world!13	hell0 world!14	hell0 world!15	hell0 world!16	hell0 world!17	hell0 world!18	hell0 world!19	hell0 world!20	hell0 world!21	hell0 world!
root@hcss-ecs-887f:~/lession1# 

more

和cat功能类似,用于逐页显示文件内容(适合查看大文件)。

root@hcss-ecs-887f:~/lession1# cnt=0; while [ $cnt -le 2000 ]; do echo "hello
world"; let cnt++; done > temp.txt
root@hcss-ecs-887f:~/lession1# more -10 temp.txt
hello
world
hello
world
hello
world
hello
world
hello
world
--More--(0%)

less

less ⼯具也是对⽂件或其它输出进⾏分⻚显⽰的⼯具,应该说是linux正统查看⽂件内容的⼯具,
功能极其强⼤
less 的⽤法⽐起 more 更加的有弹性,在 more 的时候,我们并没有办法向前⾯翻, 只能往后⾯
但若使⽤了 less 时,就可以使⽤ [pageup] [pagedown] 等按键的功能来往前往后翻看⽂件,更
容易⽤来查看⼀个⽂件的内容
除此之外,在 less ⾥头可以拥有更多的搜索功能,不⽌可以向下搜,也可以向上搜。
选项:
-i 忽略搜索时的⼤⼩写
-N 显⽰每⾏的⾏号
/字符串:向下搜索“字符串”的功能
?字符串:向上搜索“字符串”的功能
n:重复前⼀个搜索(与 / 或 ? 有关)
N:反向重复前⼀个搜索(与 / 或 ? 有关)
q:quit
基础功能:
 
root@hcss-ecs-887f:~/lession1# cnt=0; while [ $cnt -le 2000 ]; do echo "hello
$cnt"; let cnt++; done > temp.txt
root@hcss-ecs-887f:~/lession1# less -N temp.txt1 hello2 03 hello4 15 hello6 27 hello8 39 hello10 411 hello12 513 hello14 615 hello16 717 hello18 819 hello20 921 hello22 1023 hello24 1125 hello26 1227 hello28 1329 hello30 1431 hello32 15
......

 head指令

功能:

打印文件开头10行

root@hcss-ecs-887f:~/lession1# head temp.txt
hello
0
hello
1
hello
2
hello
3
hello
4
root@hcss-ecs-887f:~/lession1# #可以手动指定打印几行root@hcss-ecs-887f:~/lession1# head -5 temp.txt
hello
0
hello
1
hello
root@hcss-ecs-887f:~/lession1# 

tail

tail 命令从指定点开始将⽂件写到标准输出.使⽤tail命令的-f选项可以⽅便的查阅正在改变的⽇志⽂
件,tail -f filename会把filename⾥最尾部的内容显⽰在屏幕上,并且不断刷新,使你看到最新的⽂件内容.
root@hcss-ecs-887f:~/lession1# tail temp.txt
hello
1996
hello
1997
hello
1998
hello
1999
hello
2000
root@hcss-ecs-887f:~/lession1# 

date

用于显示或设置系统时间和日期的命令,它支持多种格式输出,还可用于计算日期和时间差

显示当前日期和时间

root@hcss-ecs-887f:~/lession1# date
Fri May  2 03:08:03 PM CST 2025
root@hcss-ecs-887f:~/lession1# 

自定义格式输出

%H : ⼩时(00..23)
%M : 分钟(00..59)
%S : 秒(00..61)
%X : 相当于 %H:%M:%S
%d : ⽇ (01..31)
%m : ⽉份 (01..12)
%Y : 完整年份 (0000..9999)
%F : 相当于 %Y-%m-%d
root@hcss-ecs-887f:~/lession1# date "+%Y-%m-%d %H:%M:%S"
2025-05-02 15:09:15
root@hcss-ecs-887f:~/lession1# 

显示相对时间

root@hcss-ecs-887f:~/lession1# date -d "1 day"                     # 1 天后
date -d "2 hours ago"               # 2 小时前
date -d "next monday"               # 下周一
date -d "2024-05-20 + 3 days"       # 2024-05-20 的 3 天后
Sat May  3 03:12:34 PM CST 2025
Fri May  2 01:12:34 PM CST 2025
Mon May  5 12:00:00 AM CST 2025
Thu May 23 12:00:00 AM CST 2024
root@hcss-ecs-887f:~/lession1# 

时间戳

在 Linux 中,时间戳(Timestamp) 表示从 1970年1月1日 00:00:00 UTC(Unix 纪元) 到当前时间的秒数(或毫秒/微秒/纳秒)

生成时间戳

date +%s       # 当前时间戳(秒级)
date +%s%N     # 纳秒级时间戳

将时间戳转化为可读格式

设置系统时间(需root权限)

sudo date -s "2025-05-1 11:00:00"  # 设置时间为 2025年5月1日 11:00

 cal

cal命令可以⽤来显⽰公历(阳历)⽇历。公历是现在国际通⽤的历法,⼜称格列历,通称阳历。“阳历”⼜名“太阳历”,系以地球绕⾏太阳⼀周为⼀年,为西⽅各国所通⽤,故⼜名“西历”。
常用选项:
-3 显⽰系统前⼀个⽉,当前⽉,下⼀个⽉的⽉历
-j 显⽰在当年中的第⼏天(⼀年⽇期按天算,从1⽉1号算起,默认显⽰当前⽉在⼀年中的天数)
-y 显⽰当前年份的⽇历
但是部分Linux系统中没有预装cal系统
可以通过以下命令安装:
sudo apt install bsdmainutils

find

Linux下find命令在⽬录结构中搜索⽂件,并执⾏指定的操作。
Linux下find命令提供了相当多的查找条件,功能很强⼤。由于find具有强⼤的功能,所以它的选
项也很多,其中⼤部分选项都值得我们花时间来了解⼀下。
即使系统中含有⽹络⽂件系统( NFS),find命令在该⽂件系统中同样有效,只你具有相应的权
限。
在运⾏⼀个⾮常消耗资源的find命令时,很多⼈都倾向于把它放在后台执⾏,因为遍历⼀个⼤的
⽂件系统可能会花费很⻓的时间(30G字节以上的文件系统)
root@hcss-ecs-887f:~/lession1# pwd
/root/lession1
root@hcss-ecs-887f:~/lession1# tree
.
├── d1
│   ├── file1.txt
│   └── filecopy1.txt
├── filecopy1.txt
├── temp.txt
└── txt2└── file1.txt2 directories, 5 files
root@hcss-ecs-887f:~/lession1# find txt2
txt2
txt2/file1.txt
root@hcss-ecs-887f:~/lession1# 

http://www.dtcms.com/wzjs/231119.html

相关文章:

  • 宝山做网站公司短期培训学什么好
  • 排名好的徐州网站开发平台宣传推广方案
  • 注册免费域名网站店铺推广怎么做
  • asp网站上传后台在哪网络营销推广工作内容
  • 襄阳棋牌网站建设营销平台是什么意思
  • app网站开发合同广东深圳今天最新通知
  • 域名备案关闭网站吗现在最好的营销方式
  • 做招聘网站需要什么seo网络优化招聘信息
  • 什么软件 做短视频网站好太原seo关键词排名优化
  • 最近做国际网站怎么样广州seo快速排名
  • 重庆网站建设必选承越seo技术最新黑帽
  • 长宁区网站建设网页在线智能识图
  • 无限免费视频在线看seo关键词排名优化报价
  • 培训的网站建设北京seo推广系统
  • 全站仪如何建站深圳网络营销推广公司
  • 网站建设和维护的教程营销工具有哪些
  • wordpress如何更换主题免费seo推广公司
  • 抓取网站源码怎么做镜像培训总结
  • 为什么政府网站总是做的很垃圾永久免费二级域名申请
  • 网站自定义链接怎么做的名站在线
  • 互粉的网站是怎么做的如何优化关键词搜索排名
  • 自己做的网站可以百度推广吗优化设计七年级上册语文答案
  • 微信链接的微网站怎么做兰州seo推广
  • 帝国cms做网站软文标题大全
  • 做百度移动网站优最新国内你新闻
  • 招聘网站数据分析怎么做互联网广告平台排名
  • 哪些网站的做的好看的外贸seo软件
  • 做视频网站空间要多大游戏推广员是违法的吗
  • 青岛做网站优化公司怎样做网站推广啊
  • 创网站需要什么企业邮箱登录入口