天津东软实训第七天

复习Linux常用命令:

shutdown now 关机

reboot 重启

mkdir 创建文件夹

mkdir -p 递归创建文件夹

touch filename 创建文件

rm -r filename 删除文件

rm -rf filename 删除文件夹

vi filename  编辑文件

i--->可编辑状态

esc --> : --->wq 保存退出 

q! 不保存退出

wq! 强制保存退出

cat 查看文件内容

grep 搜索文件某些内容

find 查看文件内容

ifconfig 查看本机IP

ping 测试是否连通

useradd 添加用户

chmod 777 filename 修改文件夹权限

more 查看更多

cp srcfile destfile 复制文件

mv 重命名,移动文件

tar -zxvf filename -C destpath 解压缩命令

ls 查看目录下所有文件

ls -a 查看目录下所有隐藏文件

pwd 查看当前目录的绝对路径

firewall: 防火墙

service iptables start/stop/status/restart 

centos7 : systemctl stop firewalld.service systemctl -cmd --state

修改网络配置文件:

/etc/sysconfig/network-scripts/ifcfg-eth1

配置环境变量

/etc/profile

~/.bash_profile

/etc/profile.d/x.sh

JAVA

export JAVA_HOME=/root/app/jdk1.8.0_161 export PATH=$JAVA_HOME/bin:$PATH

配置文件生效:

source ~/.bash_priofile

查看java安装目录

echo $JAVA_HOME

HDFS Shell 操作:

1,查看Hdfs上的文件

hdfs dfs -ls /

hadoop fs -ls /

2,将本地文件上传到hdfs

hdfs dfs -put hello.txt /

3,查看hdfs文件内容

hdfs dfs -cat /hello.txt

hdfs dfs -text /hello.txt

4,在hdfs创建目录

hdfs dfs -mkdir /hello

5,hdfs递归创建目录

hdfs dfs -mkdir -p /test/a/b 

6,递归查询目录

hdfs dfs -ls -p /test

7,将hdfs上的文件下载到本地

hdfs dfs -get /hello.txt

8,将本地文件拷贝到hdfs上 /test/a/b

hdfs dfs -copyFromLocal hello.txt /test/a/b/h.txt

9,删除hdfs上目录

hdfs dfs -rm -R /hello

10,删除hdfs上的文件

hdfs dfs -rm /hello.txt

 

转载于:https://www.cnblogs.com/huyangyang/p/9321460.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值