当前位置:网站首页>Liunx Foundation
Liunx Foundation
2022-06-12 05:49:00 【Python's path to becoming a God】
Linuxshell Interpreter
One 、 Basic commands ( To continue )
1. cp copy Copy -copy files and directories
copy source to destination
Copy file :
Single file :
touch f.txt
ls
mkdir hunan
cp f.txt hunan f.txt Copy to current directory hunan in
Copying multiple files :
cp lu.txt wu.txt zhang.txt hunan
command Source file Destination
cp *.txt sc The use of wildcards
Using absolute paths
cp /etc/hostname /lianxi/hunan
ls hunan
Copy 、 Paste 、 rename
cp f.txt feng.txt
Set the f.txt Copy to the current directory and rename it feng.txt
Copy folder :
-r recursive copy directories recursively
cp hunan beijing -r Recursive replication hunan Folder to Beijing folder
Copy multiple folders :
cp /boot /var /lianxi/hunan -r
skip cp Override reminder :
1、 Remove alias , Don't use -i Options
unalias cp
cp /var /boot /lianxi/sc -r
2、 Use cp The absolute path of command
/usr/bin/cp /var /boot /linaxi/sc -r
mv shear
1、 When the following folder exists , It's mobile.
2、 When the following file or folder does not exist , It's renaming
mv beijing/ changsha/ lu.txt guangdong/
Move 、 Paste 、 rename
mv xiao.txt yue/xw.txt
which Find out where the command is
which cp
/usr /bin/cp
Two 、 Basic concepts
1. -usr unix system resource
System resources
2.bin binary Binary system
3.shell Interpreter : It's a program , The user accepts user input , Then analyze the syntax of the command entered by the user , Know what commands are , What are the parameters , What are the options , Will tell us linux The kernel starts related processes
4、 What the kernel does : The kernel is linux The core software inside
1. Yes cpu Scheduling management
2. Allocate memory
3. Manage file systems
4. Manage processes
5. Manage other hardware
5.shell Script : scripts
A script is actually a file , There are a lot of linux command
vi yes linux Text editor in --》 Notepad
vi yes linux Character interface Notepad , Used to write scripts , Modify the contents of the document
[[email protected] lianxi]# vi hello.sh Script name
1. By letter i Get into vi The input mode of the editor insert
2. Input content
3. Press ESC key , Leave input mode escape
4. Input :wq Enter last line mode , Exit and save w write q quit
cat hello.sh View the script hello.sh Contents of Li
mkdir wujun
cd wujun
# Use for How many empty files are created in a circular batch
for i in {1..100}
do
touch sc$i.txt
done
ls
# Output one hello world
echo "hello,wolrd"
# Judge sc200.txt Whether there is
if [ -f sc200.txt ]
then
echo "create file sc200.txt ok"
else
echo "no file sc200.txt"
fi
3、 ... and 、 practice
Write a script sc_yourname.sh
Realization function :
1. stay / Directory create a new folder hunansc
2. stay /hunansc New under the directory feng1 To feng200 Folder
3. Output a paragraph , I'm learning shell Script
4. Judge /hunansc Whether there is a folder under the directory feng80 This folder , If there is an output feng80 dir is exist
If there is no output feng80 dir is not exist
[ -d feng20 ] Judge feng20 Whether there is
5. Show all created feng1 To feng80 Effects of folders
mkdir /hunansc
for i in {1..200}
do
mkdir feng$i
done
echo "i am learning shell scripts!"
if [-d feng80]
then
echo "feng80 dir exists"
else
echo "feng80 dir is not exist"
fi
ls
边栏推荐
- Nrf52832 -- official routine ble_ app_ UART adds the LED feature to enable the computer UART and mobile app to control the LED on and off of the development board
- [daily question on niuke.com] two point search
- Database experiment I: data definition experiment guide
- Special materials | household appliances, white electricity, kitchen electricity
- Conversion of Halcon 3D depth map to 3D image
- Details of FPGA syntax
- beginning一款非常优秀的emlog主题v3.1,支持Emlog Pro
- flex/fixed上中下(移动端)
- 项目开发流程简单介绍
- Research Report on water sports shoes industry - market status analysis and development prospect forecast
猜你喜欢

March 22, 2021

论文阅读_图神经网络GIN

CCF noi2022 quota allocation scheme

Makefile文件编写快速掌握

GRP development: four communication modes of GRP

Available RTMP and RTSP test addresses of the public network (updated in March, 2021)

Individual application for ov type SSL certificate

数据集成框架SeaTunnel学习笔记

RTMP streaming +rtmp playback low delay solution in unity environment

登录验证过滤器
随机推荐
项目管理与统筹
Chapter 7 - pointer learning
About architecture (in no particular order)
Conversion of Halcon 3D depth map to 3D image
Halcon 3D 1 Reading 3D data
MySQL notes
Flutter monitors application lifecycle status
March 23, 2021
Greenplum【问题 05】Greenplum Streaming Server自定义客户端问题处理(不断增加ing)
Select gb28181, RTSP or RTMP for data push?
Database Experiment 3: data query
Heap classical problem
Thesis reading_ Figure neural network gin
BlockingQueue interface introduction
Unity VSCode不能跳转到定义
Market trend report, technical innovation and market forecast of Chinese stump crusher
What is the lszrz protocol used at ordinary times? Talk about xmodem/ymodem/zmodem
[machine learning] first day of introduction
从传统网络IO 到 IO多路复用
[untitled]