Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.org

Introduction

This is the training ground for shell.

Example

Move file to a not exist dir

# `mkdir --parents` equal to `mkdir -p`
# $_ expands to the last argument passed to the previous shell command, ie: the newly created directory.
mkdir --parents ./some/path; mv youfile.txt $_

Replace all string in certain dir

sed -i "s/Before_str/After_str/g" `grep Before_str -rl ./some/path`

Wget dowload continue

# -c,  --continue                  resume getting a partially-downloaded file
wget -c <download_url>

Debug bash scripts

bash -x xxx.sh

ShellCheck

ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts.

Installation

sudo apt install shellcheck

Reference Links