Shell language study notes_1

The previous blogs mentioned that the Ubuntu dual system was recently installed for some reasons. For a person who is used to operating with a mouse click, when using the command line, I feel like I am a primitive person who is used to catch prey with a stick. , Homo sapiens from the future suddenly gave me a laser gun, making it as difficult for me to kill an elephant, so the tossing party prepared to learn the Shell language by myself.

Let me talk about the source of the course first. This course comes from the learning software station B. Hang up the link:

https://www.bilibili.com/video/BV1ii4y1t7Vf

Then, this type of post is mainly used to put my study notes. If you like, you can study together. I also ask the big guys for guidance. Thank you!

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

System password sudo vi /etc/shadow (after hashing)
other passwords sudo vi /etc/passwd

Return to the upper level command cd..
   cd-
return to the upper level directory and execute ls (view the directory): cd..;ls
do not return to the upper level directory and execute the shell (view the directory): ( cd..;ls)
leave vi .bashrc blank
. .bashrc takes effect and
source .bashrc takes effect

External command: depends on the path environment variable

env | grep $PATH path environment variable
vi .bash

----------------------------------------------------------------------------------------------------------------
test.sh
#!/bin/sh  #指定解析器
#This is to show what a exaple looks like 
echo "Our first Example."
echo "We are  currently in the following diractory"
echo ""
/bin/pwd
echo
echo "This diractory contains following files"
/bin/ls
---------执行chmod a+x sample.sh (664不可以) --a == all
---------./sample.sh
---------source sample.sh
---------解析 /bin/bash sample.sh
---------. sample.sh
---------./ sample.sh

 

 

Guess you like

Origin blog.csdn.net/Hsk_03/article/details/106165562