当前位置:网站首页>Rhcsa day 3 operation
Rhcsa day 3 operation
2022-04-23 02:36:00 【Enron tears】
1、 Create directory test
In two ways test Create a text file in the directory text1.txt,text.txt
[root@localhost ~]# mkdir test [root@localhost ~]# cd test [root@localhost test]# touch text1.txt [root@localhost test]# vim text.txt [root@localhost test]# ls text1.txt text.txt
Use vim In the file text.txt writes
Welcome to my Linux. You are the best. This is my first file to create on linux.
[root@localhost test]# vim text.txt # Get into vim After editor , Press a Key to enter edit mode , When the input is complete, press Esc Key to exit edit mode , Press again :wq Save and exit vim Welcome to my Linux. You are the best. This is my first file to create on linux.
set nu , And put it in the text my Replace with your, Save the file as new_test1.txt
# Get into vim Post press : key , Enter last line mode , Input set nu set nu # Enter... In last line mode %s/my/your/g, You can put the in the full text my Replace with your # Enter... In last line mode w new_test1.txt, You can save the file as
take test Copy the files in to test2 Catalog
[root@localhost ~]# cp -a test test2
take test2 In the directory text1.txt Rename it to text111.txt
[root@localhost ~]# cd test2 [root@localhost test2]# mv text1.txt text111.txt
stay test2 Create a new text111.txt Soft link file for test111Symb.txt
[root@localhost test2]# ln -s text111.txt test111symb.txt
stay test2 Create a new test111.tbxt Hard link file for test111hard.txt
[root@localhost test2]# ln text111.txt test111hard.txt
Delete test Directory test1.txt
[root@localhost test]# rm -rf test1.txt
Delete test Catalog
[root@localhost ~]# rm -rf test
2、 take echo"This is my first time to use pipe" Output content to the screen , And save it to pipe_data.txt in
[root@localhost ~]# echo "This is my first time to use pipe" | tee pipe_data.txt This is my first time to use pipe [root@localhost ~]# more pipe_data.txt This is my first time to use pipe
3、 File content browsing
a.cat see /etc/passwd The contents of the document , And output with line number
[root@localhost ~]# cat -n /etc/passwd
b. Use more/less see /etc/passwd Content , And each page displays 10 That's ok
more command : [root@localhost ~]# more -10 /etc/passwd less command : [root@localhost ~]# less -10 /etc/passwd
c. Use head/tail Before viewing the files separately 5 Line content and after 5 Row content
head Command before viewing the file 5 Row content : [root@localhost ~]# head -5 /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin tail Command to view the file 5 Row content : [root@localhost ~]# tail -5 /etc/passwd gdm:x:42:42::/var/lib/gdm:/sbin/nologin gnome-initial-setup:x:975:975::/run/gnome-initial-setup/:/sbin/nologin tcpdump:x:72:72::/:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
版权声明
本文为[Enron tears]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220815166644.html
边栏推荐
- Go language ⌈ mutex and state coordination ⌋
- WordPress calls the specified page content. 2 get_ children()
- 009_ Redis_ Getting started with redistemplate
- 使用Go语言构建Web服务器
- 【无标题】
- Niuke hand speed monthly race 48 C (I can't understand the difference. It belongs to yes)
- Real math problems in 1958 college entrance examination
- Hyperscan -- 2 compilation
- Tp6 Alibaba Cloud SMS Window message Curl Error 60: SSL Certificate Problem: Unable to get local issuer Certificate
- 谷雨
猜你喜欢
R language advanced | generalized vector and attribute analysis
16、 Anomaly detection
How to solve the complexity of project document management?
Parental delegation model [understanding]
Web learning record (medium)
Usage of vector common interface
How to prevent leakage of operation and maintenance data
JVM运行时数据区(一)
Flink stream processing engine system learning (I)
手写内存池以及原理代码分析【C语言】
随机推荐
[XJTU computer network security and management] Lecture 2 password technology
Download the genuine origin Pro 2022 tutorial and how to activate it
牛客手速月赛 48 C(差分都玩不明白了属于是)
006_ redis_ Jedis quick start
一、序列模型-sequence model
Want to experience homekit smart home? Why don't you take a look at this smart ecosystem
手写内存池以及原理代码分析【C语言】
The usage and difference of * and & in C language and the meaning of keywords static and volatile
SQL server2019 cannot download the required files, which may indicate that the version of the installer is no longer supported. What should I do
双亲委派模型【理解】
JVM runtime data area (I)
Kubernetes cluster installation based on Kirin SP10 server version
LeetCode 283. Move zero (simple, array) Day12
Lane cross domain problem
Flink real-time data warehouse project - Design and implementation of DWS layer
程序设计天梯赛 L1-49 天梯赛分配座位(模拟),布响丸辣
Hyperscan -- 2 compilation
MySQL JDBC编程
How many steps are there from open source enthusiasts to Apache directors?
Wechat public platform test number application, authorized login function and single sign on using hbuilder X and wechat developer tools