Professional Documents
Culture Documents
Commands
(Linux Based Commands)
Commands
1. ~]$pwd- present work directory
2. ls
3. ls –l
If start with – then it is a file
If start with d then it is a directory
CAT comand
Cat>>
Creating a file if
it is not available Cat
Cat> Display content
Creating a file And for
appending text of the file
to the already
existed file
training@localhost ~]$ cat>>demo.txt
Am Back
training@localhost ~]$cat demo.txt
Hii how are you
How was your job goining on?
Am Back
b) Vi editor
Three modes in vi editor:
Esc mode(esc button)(by default mode)
Insert mode (press ‘i’ )
Colon mode (press “shift + ‘;’)
directory
But if src is a directory then dest should be
directory
16. Cut and paste
[training@localhost glbajaj]$ mv <src> <dest>
17. Two ways two display content of file:
Absolute path
[training@localhost glbajaj]$ cat
home/training/glbajaj/bigdata/teacher/stude
nt/file.txt
Relative path
[training@localhost glbajaj]$cat
bigdata/teacher/student/file.txt
Command Of Hadoop
Hadoop fs
hadoop fs -ls
hadoop fs -mkdir newdirectory
hadoop fs -ls
hadoop fs -put /home/training/file3.txt newdirectory
hadoop fs -put /home/training/Desktop/hello.txt newdirectory
hadoop fs -copyFromLocal /home/training/Desktop/tem.txt
/user/training/newdirectory
hadoop fs -moveFromLocal /home/training/Desktop/tem.txt
/user/training/newdirectory
hadoop fs -get /user/training/newdirectory/tem.txt /home/training/Desktop
◦ -copyToLocal
hadoop fs -cat newdirectory/tem.txt
hadoop fs -rm newdirectory/tem.txt
hadoop fs –rmr aaa
hadoop fs -cp /user/training/newdirectory/file3.txt aaa
hadoop fs -cp /user/training/newdirectory/file3.txt filea.txt
hadoop fs -mv /user/training/newdirectory/file3.txt /user/training/abbcc/filea3.txt
HDFS - fsck (File System Check)