常用命令总结

常用命令总结

    • 1.大数据相关
    • 2.conda,jupyterlab 相关
    • 3.文件处理相关
    • 4.git相关
    • 5.mvn相关
    • 6.hive-sql相关

1.大数据相关

# 服务启动关闭
cd /opt/module

./spark-2.4.5/sbin/stop-all.sh
hiveservices.sh stop
stop-all.sh

start-all.sh
hiveservices.sh start 
./spark-2.4.5/sbin/start-all.sh

# 常用命令
hadoop fs -ls / | -put file1 dir1 | -cat file1 
./bin/spark-submit --master local[24] --deploy-mode client --queue default --num-executors 2 --driver-memory 1g --class org.apache.spark.examples.sql.SparkSQLExample ./examples/jars/spark-examples_2.11-2.4.5.jar

2.conda,jupyterlab 相关

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ # 增加镜像源
conda config --set show_channel_urls yes
conda info -e # 查看现有环境
conda create --name mypy3 python=3 # 创建新虚拟环境
conda activate mypy3 #激活环境
conda install ipykernel
python -m ipykernel install --user --name ml --display-name "ml"
conda deactivate mypy3 #退出环境
conda env remove --name mypy3  # 删除环境


jupyter kernelspec list # 查看jupyter已有内核
# cuda
# tensoflow

3.文件处理相关

# grep
# awk

4.git相关

5.mvn相关

6.hive-sql相关

参考:https://blog.csdn.net/qiulinsama/article/details/86655194(使用多个分隔符)
参考:https://blog.csdn.net/song_quan_/article/details/121765989(hive从文件导入数据)
参考:https://www.cnblogs.com/duanxz/p/9015937.html (hive导入导出)
参考:https://blog.csdn.net/qq_25534101/article/details/115189732(多种创建表)

# 创建单个分隔符的hive表
create table if not exists stu(id int,name string) row format delimited fields terminated by ',' stored as textfile location 'hive存储数据路径';
# 创建多个分隔符的hive表
create table if not exists movie_movies(movie_id int,title string,genres string) 
row format SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe'
WITH SERDEPROPERTIES ("field.delim"="::")
stored as textfile 
location '/jupyter-data/movies.dt'
# 从本地文件上传数据到hive:
load data local inpath '/home/movies.dat' into table movie_movies;

你可能感兴趣的:(linux,linux,运维,服务器)