How do I create a script in Ubuntu?

Phạm Quyết

New member
How do I create a script in Ubuntu?
Answer
How to Write a Shell Script Using Bash Shell in Ubuntu
  1. Launch the Terminal.
  2. Launch the vi/vim editor.
  3. In the terminal window, type vim ListDir.sh and hit ↵ Enter .
  4. At the top, type the following code: #!/bin/bash .
  5. Type the code as shown in the figure.
  6. Type the following key combinations, Esc + : + wq to escape the editor.
  7. Enter the following command: chmod +x ListDir.sh.
 

Tìm kiếm

Back
Top