linux常用命令總結

2021-10-02 02:37:46 字數 2325 閱讀 2990

一:常用sql

1)檢視分割槽

2)新增分割槽

alter

partition

(partition_date =

'2019-10-24'

); 新增分割槽

3)刪除分割槽

alter

partition

(pt=

'2019-10-22'

);刪除分割槽

4)殺死yarn程序

5)檢視分割槽

show partitions 表名   檢視分割槽
6)刪除表資料

truncate

table 表名 刪除表資料

7)外部表轉內部表

alter

table tablea set tblproperties(

'external'

='false'

) 外部表轉內部表

8)檢視表結構的詳細資訊

desc formatted table

;

9)刪除表

drop

table

ifexists

table

; 刪除表

10)本地匯入到hive

load

data

local inpath '/222.csv'

into

table dw_test1; 本地匯入到hive

11)新增語句

insert overwrite table 新錶名  partition

(partition_date =

'2019-10-24'

)select

*from

default

.舊表名 where w_upd_dt <

'2019-10-25 00:00:00.0'

;

12)檢查是否有序列

select

*from

default

.表名 where length(nvl(cast(last_mdf_dt as string),''

))=0

limit

1;

13)當前資料庫

select current_database(

)

二:spark命令

1)spark-shell

cat so_log1.scala | spark-shell \

--name empty_test \

--conf spark.driver.memory=2g \

--conf spark.executer.memory=2g \

--conf spark.executer.cores=4 \

--conf spark.executer.instances=2 \

--conf spark.kryoserializer.buffer.max=512m \

--conf spark.dynamicallocation.enabled=false \

--conf spark.sql.shuffle.partitions=100 \

--conf spark.driver.maxresultsize=4g \

--conf spark.broadcast.blocksize=100m \

>> so_log1.txt

2)spark-submit

bin/spark2-submit --class woobooorderstreamingkafka  --master yarn --executor-memory 2g --total-executor-cores 2 /taskjar/spark-wooboo-1.0.jar 2>&1 | tee /submit.log
三:tumx的使用

安裝tmux:yum install tmux

新建會話:tmux new -s aaa

檢視會話:tmux ls

進入會話:tmux a -t aaa

斷開會話:tmux detach

關閉會話:tmux kill-session -t aaa

Linux常用命令總結

下面這些命令是我在複習linux時記錄的,沒有詳解,只記錄了簡單的用法 檢視物理cpu個數 cat proc cpuinfo grep physical id sort uniq wc l 檢視物理cpu中core的個數,即核心數 cat proc cpuinfo grep cpu cores un...

LINUX常用命令總結

readlink f 找出符號鏈結所指向的位置 1g 到我檔案頭 g到檔案尾 cat瀏覽檔案 netstat a 檢視所有埠 mkdir 建立資料夾 rm rf 刪除檔案 執行指令碼 指令碼檔案 在當前目錄下 在目錄中查詢檔案 find 檔名 根目錄 當前目錄 剪下 mv vi命令 在檔案中搜尋關鍵...

Linux 常用命令總結

mkdir 建立目錄 ls l 顯示目錄或檔案 cd 切換目錄層次 cat n顯示行號 檢視檔案內容 cat demo.text eof 建立檔案 結尾eof退出編輯狀態 tac 反轉內容輸出 cp apr 拷貝檔案或者目錄 rm f 強制刪除檔案 r 遞迴刪除 刪除檔案或目錄 fr 刪除指定的目錄...