2019-2020-1 20199325 "Linux kernel principle and Analysis" in the first week of operation

1. Display a word welcome

!/bin/bash

script4-1.sht

var1="welcome to use Shell script"
echo $var1
pwd
ls -i

  1. Using the function to determine whether a number is a prime number

!/bin/bash

script4-17.sht

testfile()

{
if [-d $1]
then
echo "$1 is a directory!"
else
echo "$1 is not a directory"
fi
return
}

testfile $1

3. function to determine the magnitude relation between two numbers

1.pwd command:
show the absolute pathname of the current directory

2.cd command:
changes the current directory

3.Mkdir command
to create a directory with the specified name

4.Rmdir command:
delete empty directories specified name

5.Ls command
displays the file and directory information

6.Cp command
to copy the source file to the target file

7.Rm command
list to delete the files in the

Guess you like

Origin www.cnblogs.com/buhery/p/11524957.html