Shell programming skills

Shell programming (notes)

In the case of file permission . / file (that is to execute) execute the file
without permission . . /File (can be executed, it is two dots not a period)

Task in front and back

  • Pause the currently executing task-Ctrl+z
  • View suspended tasks-jobs
  • Put the task in the background and continue to run-bg task number
  • Put the task in the foreground and continue to run-fg task number

echo

  • Cancel line breaks-echo-n "Hello word!"
  • Print escape character-echo-e "\n"

Custom command alias

Only settings in the corresponding configuration file will take effect permanently

  • [root@root~]# vi .bashrc
  • # Add an alias for the shutdown command
  • Shutdown=‘shutdown -h -now’

Guess you like

Origin blog.csdn.net/sugarbew/article/details/105820959