HDFS上传
1_hadoop fs -mkdir /test (在hadoop创建一个文件)
2_ hadoop fs -ls /test(浏览文集夹)
3_ hadoop fs -put jdk-8u192-linux-x64.tar.gz /test(上传到指定文件夹)
4_hadoop fs -lsr /(递归查看所有文件和目录)
5_hadoop fs -cat /test/a.txt(查看文件内容)
6_hadoop fs -mv /test/a.txt /test02/b.txt(移动并重命名)
7_ hadoop fs -cp /test02/b.txt /test/a.txt(复制并重命名)
8_ hadoop fs -rm /test/jdk-8u192-linux-x64.tar.gz(删除)
linuxSHELL
1.加减乘除
#!/bin/bash
read -p “请输入第一个数字” x
read -p “请输入第二个数字” y
read -p “请输入操作符” op
if [ “$op” == “+” ]
then
echo
[
x
+
y
]
e
l
i
f
[
"
[ x + y ] elif [ "
[x+y]elif["op" == “-” ]
then
echo
[
x
−
y
]
e
l
i
f
[
"
[ x -y ] elif [ "
[x−y]elif["op" == “*” ]
then
echo
[
x
∗
y
]
e
l
i
f
[
"
[ x * y ] elif [ "
[x∗y]elif["op" == “/” ]
then
if [ $y == 0 ]
then
echo “分母不能为零”
else
echo $[ x / y ]
fi
fi
2.for
#!/bin/bash
for((i=1;i<=10;i++))
do
echo $i
done
#!/bin/bash
for i in $(seq 1 10)
do
echo $i
done
#!/bin/bash
for i in {1…10}
do
echo $i
done
3.while
#!/bin/bash
i=1
while [ $i -le 10 ]
do
echo
i
i
=
i i=
ii=[ $i + 1 ]
done
#!/bin/bash
i=0
sum=0
while [
i
−
l
e
100
]
d
o
s
u
m
=
i -le 100 ] do sum=
i−le100]dosum=[ sum + i ]
i=$[ i + 1 ]
done
echo
s
u
m
s
u
m
=
0
f
o
r
(
(
i
=
1
;
i
<
=
100
;
i
+
+
)
)
d
o
s
u
m
=
sum sum=0 for((i=1;i<=100;i++)) do sum=
sumsum=0for((i=1;i<=100;i++))dosum=[ sum + i ]
done
echo $sum
3.
#!/bin/bash
for str in ls ${1}
do
echo $str
done
#!/bin/bash
for str in ps -ef
do
echo $str
done