Linux commonly used advanced commands and shell scripts

1. linux

1. 21 common commands for enterprise Linux

  • login: log in to the system, the use authority is all users
  • shutdown: Shut down the computer, use the super user (root)
  • halt: Shut down the system, the use authority is super user
  • reboot: restart the computer, the use authority is the system administrator
  • install: install or upgrade software or backup data, the use authority is all users
  • mount: mount the file system, the permission is super user or users allowed in /etc/fstab
  • umount: Unmount a file system, use permissions as above
  • chsh: change the user shell settings, the permission is for all users
  • exit: Exit the system, all users are authorized to use
  • last: Display the login status of recent users or terminals, the authority is all users
  • file: Judge the file type by detecting the content of the file, the permissions are all users
  • mkdir: create a directory, use permissions for all users
  • grep: search for specific content in the specified file, and output the line containing these content to the standard output
  • cp: copy files
  • mv: move files
  • find: Search for files in the directory
  • ls: Display the contents of the directory
  • cat: Used to connect and display information about the specified one or more files
  • cd: switch directory
  • pwd: Display the current working directory
  • touch: Create an empty file or update an existing file
  • echo: print the content
  • rm: delete files
  • less: display the contents of the file in pages, and move the cursor forward and backward
  • more: display content in pages but can only move backwards
  • head: View the first few lines of the file
  • tail: View the last few lines of the file, -f -F continuously monitor
  • ln: Generate link file
  • which: view the directory where the command is located
  • tar: unzip and package
  • vi: document editing

2. Commonly used advanced commands

  • ps -ef
  • top
  • df -h
  • uptime
  • netstat

3. View disk usage, view process, view port

  • df -h: View disk usage
  • ps -ef: view process
  • netstat: view port

Two.shell

1. Commonly used tools

awk , sed , cut , sort

2. Cluster start distribution script

Kafka one-click startup as an example

#!/bin/bash
for i in hadoop01 hadoop02 hadoop03
path='/usr/app/kafka_2.11-1.1.1'
do
	ssh $host "source /etc/profile;nohup ${path}/bin/kafka-server-start.sh ${path}/config/server.properties>/dev/null 2>&1 &"
	echo "$host kafka is running"
done

3. Import and export of data warehouse and MySQL

4. Import inside the data warehouse hierarchy

Guess you like

Origin blog.csdn.net/weixin_47699191/article/details/111284302