su hdfs //切換到hdfs使用者
cd /home/hdfs/files //進入到伺服器中檔案所在目錄
ls //檢視此目錄下的檔案列表
vim test.txt //若檔案存在可顯示檔案中的內容,若不存在則新建檔案
test.txt檔案中的內容:
1 15673830092 aaa
2 15837287388 bbb
3 15008378273 ccc (以tab分割)
:wq! //儲存檔案並退出
ls //可看到目錄中已新增好test.txt檔案
hdfs dfs -put /home/hdfs/files/test.txt /input //將本地檔案上傳到hdfs中,前面為伺服器中檔案路徑,後面為hdfs中檔案路徑
hdfs dfs -ls /input //可發現hdfs路徑中新增test.txt檔案
hdfs dfs -cat /input/test.txt //顯示檔案中的內容
上傳本地檔案到GitHub
前段時間將自己的專案通過命令列的方式上傳至github遇到一些問題,也總結了一些經驗,在這裡分享給大家乙個上傳步驟 第一步 建立你的git倉庫 命令列cd到你的專案資料夾裡面,執行git命令建立倉庫 git init第二步 選擇要新增進倉庫的檔案git add 如果想新增指定的檔案,就去掉.就ok了...
git 上傳本地檔案到github
git 上傳本地檔案到github 1 git config global user.name your real name 2 git config global user.email you email.address git init git add git commit m test git...
git 上傳本地檔案到github
git 上傳本地檔案到github 1 git config global user.name your real name 2 git config global user.email you email.address git init git add git commit m test git...