当前位置:网站首页>0717RHCSA
0717RHCSA
2022-07-25 13:18:00 【Psc_ February2】
Use tar Command to package, compress and decompress files :
Use gzip Compress the file in , And specify the compression name as tar_gzip.tar.gz
Use bzip2 Compress the folder in , And specify the compression name as tar_bzip2.tar.bz2
Use xz Compress the file in , And specify the compression name as tar_xz.tar.xz
[[email protected] ~]# tar czf tar_gzip.tar.gz tar_file1 tar_file2 tar_file3
[[email protected] ~]# tar cjf tar_bzip2.tar.bz2 tar_file1 tar_file2 tar_file3
[[email protected] ~]# tar cJf tar_xz.tar.xz tar_file1 tar_file2 tar_file3
[[email protected] ~]# ls -l
-rw-r--r--. 1 root root 145 Jul 18 13:55 tar_bzip2.tar.bz2
-rw-r--r--. 1 root root 0 Jul 18 13:50 tar_file1
-rw-r--r--. 1 root root 0 Jul 18 13:50 tar_file2
-rw-r--r--. 1 root root 0 Jul 18 13:50 tar_file3
-rw-r--r--. 1 root root 147 Jul 18 13:55 tar_gzip.tar.gz
-rw-r--r--. 1 root root 188 Jul 18 13:56 tar_xz.tar.xz
New file file1.txt,file2.txt,file3.txt
The file file1.txt and file2.txt, Compress ( Use gzip The way ), exclude file3.txt( That's not right file3 Compress )
And specify the compression name as tar_file.tar.gz
[[email protected] ~]# tar -cvf tar_file.tar.gz flie[!3].txt flie1.txt flie2.txt [[email protected] ~]#New file file4.txt, take file4.txt Add to tar_file.tar.gz in
View compressed package tar_file.tar.gz What files and directories are there ( Do not decompress , Only view )
decompression tar_gzip.tar.gz To the specified directory tar_test( Without this directory, create )
[[email protected] ~]# touch file4.txt [[email protected] ~]# tar -rvf tar_file.tar.gz file4.txt file4.txt [[email protected] ~]# tar tf tar_file.tar.gz flie1.txt flie2.txt file4.txt [[email protected] ~]# mkdir tar_test [[email protected] ~]# tar xzf tar_gzip.tar.gz -C tar_test [[email protected] ~]#decompression tar_xz.tar.xz
[[email protected] ~]# tar xvf tar_xz.tar.xz tar_file1 tar_file2 tar_file3stay Linux Upper /root Create a directory Linux.txt, stay windows To create a windows.txt
- adopt sftp Of get and put command , take windows Upper windows.txt Pushed to the linux On
sftp> put C:\Users\jameth\Desktop\Windows.txt /root/ Uploading C:/Users/jameth/Desktop/Windows.txt to /root/Windows.txt C:/Users/jameth/Desktop/Windows.txt 100% 0 0.0KB/s 00:00 sftp>adopt sftp Of get and put command , take linux Upper linux.txt Pushed to the windows On
sftp> get /root/Linux.txt C:\Users\jameth\Desktop\ Fetching /root/Linux.txt to C:/Users/jameth/Desktop/Linux.txt sftp>Create a normal variable local_data=1 And access
[[email protected] ~]# export local_data=1 [[email protected] ~]# echo $local_data 1Create environment variables ROOT_DATA=root, Only root Users can access
[[email protected] ~]# vi /root/.bashrc [[email protected] ~]# source /root/.bashrc [[email protected] ~]# echo $ROOT_DATA rootCreate environment variables USER_DATA=user, Only ordinary users can access
[[email protected] ~]# export USER_DATA=user [[email protected] ~]# echo $USER_DATA user- Create environment variables DATA=all, root Both users and ordinary users can access
[[email protected] ~]# vi /etc/profile [[email protected] ~]# source /etc/profile [[email protected] ~]# echo $DATA allestablish 3 File test1.txt, test2.txt, test3.txt
- Use find lookup test1.txt,test2.txt, test3.txt
- Use the alias : Name the above command myfind
- Remove alias
[[email protected] ~]# touch test1.txt [[email protected] ~]# touch test2.txt [[email protected] ~]# touch test3.txt [[email protected] ~]# find test[1-3].txt test1.txt test2.txt test3.txt [[email protected] ~]# alias myfind=find [[email protected] ~]# myfind test[1-3].txt test1.txt test2.txt test3.txt [[email protected] ~]# unalias myfind [[email protected] ~]# myfind test[1-3].txt bash: myfind: command not found... [[email protected] ~]#View recently used 10 Historical orders
[[email protected] ~]# history 10 122 find test[1-3].txt 123 touch test1.txt 124 touch test2.txt 125 touch test3.txt 126 find test[1-3].txt 127 alias myfind=find 128 myfind test[1-3].txt 129 unalias myfind 130 myfind test[1-3].txt 131 history 10Execute two commands on one line , Print 123 And from the root Switch to normal user
[[email protected] ~]# printf 123 ; su rhcsa 123[[email protected] root]$Examples of the use of quotation marks : No quotes , Single quotation marks , Double quotes , The quotation marks ,$()
[[email protected] ~]# numb=1 [[email protected] ~]# echo "$numb" 1 [[email protected] ~]# echo '$numb' $numb [[email protected] ~]# n=pwd [[email protected] ~]# echo $n pwd [[email protected] ~]# n=`pwd` [[email protected] ~]# echo $n /root [[email protected] ~]# n=$(ls) [[email protected] ~]# echo $n aafile afile anaconda-ks.cfg args.txt a.txt bbfile bfile cut_data.txt Desktop Documents Downloads f1 f2 f3 file1 file2 file4.txt flie1.txt flie2.txt flie3.txt info_txt initial-setup-ks.cfg Linux.txt Music num.txt Pictures Public sort2.txt sort_args.txt sorted_args.txt sorted_merge.txt sorted_num.txt sort.txt tar_bzip2.tar.bz2 tar_file1 tar_file2 tar_file3 tar_file.tar.gz tar_gzip.tar.gz tar_xz.tar.xz Templates test1.txt test2.txt test3.txt uniq_data.txt Videos Windows.txt zfile zzfile [[email protected] ~]#
边栏推荐
- Friends let me see this code
- 说说对hashcode和equals方法的理解?
- Handwriting a blog platform ~ first day
- [review SSM framework series] 15 - Summary of SSM series blog posts [SSM kill]
- 好友让我看这段代码
- Error: cannot find or load main class XXXX
- Excel import and export source code analysis
- Brpc source code analysis (III) -- the mechanism of requesting other servers and writing data to sockets
- 【AI4Code】《IntelliCode Compose: Code Generation using Transformer》 ESEC/FSE 2020
- Django 2 ----- database and admin
猜你喜欢

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略

massCode 一款优秀的开源代码片段管理器

【服务器数据恢复】HP EVA服务器存储RAID信息断电丢失的数据恢复

Excel录制宏

Convolutional neural network model -- alexnet network structure and code implementation

C # basic learning (XXIII)_ Forms and events

Vim技巧:永远显示行号

Masscode is an excellent open source code fragment manager

IM系统-消息流化一些常见问题

Connotation and application of industrial Internet
随机推荐
【GCN-CTR】DC-GNN: Decoupled GNN for Improving and Accelerating Large-Scale E-commerce Retrieval WWW22
7行代码让B站崩溃3小时,竟因“一个诡计多端的0”
Zero basic learning canoe panel (15) -- CAPL output view
G027-OP-INS-RHEL-04 RedHat OpenStack 创建自定义的QCOW2格式镜像
Concurrent programming - memory model JMM
[six articles talk about scalablegnn] around www 2022 best paper PASCA
Zero basic learning canoe panel (16) -- clock control/panel control/start stop control/tab control
二叉树基本知识
Shell常用脚本:判断远程主机的文件是否存在
Mu Changchun, data Research Institute of the central bank: controllable anonymity of digital RMB is an objective need to safeguard public interests and financial security
全网最简单解决方式1045-Access denied for user [email protected](using password:YES)
Introduction to web security UDP testing and defense
Word style and multi-level list setting skills (II)
Pytorch creates its own dataset and loads the dataset
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
卷积神经网络模型之——GoogLeNet网络结构与代码实现
[review SSM framework series] 15 - Summary of SSM series blog posts [SSM kill]
Handwriting a blog platform ~ first day
0719RHCSA
Arrays常用方法