Common linux commands and usage scenarios

Time:2021-12-2

1. Count the size of tables in the cluster    The tables created in hive are stored in the cluster (/ user / hive / warehouse)

hadoop  fs  -du  /user/hive/warehouse/test     

2. View logs dynamically

tail  -1000f    namenode.log

3. View the specific process under a server

jps    If you can’t find this command, check whether Java is configured in the environment variable of the server_ HOME

4. Check whether a port is listening

ps  -ef  | grep 8080

5. Backup files

Enter the absolute directory of the file    cp     test.txt      / home

6. Install software   Usually on your own virtual machine   When you can connect to the Internet

Execute: yum   install    – y    mysql

If the server cannot connect to the Internet, please download the installation package     Tar packages are common under Linux. Extract and install them

7. View log by time

  ll -lrt