Bash Scripting:
Bash, which is short for Bourne-again shell, is a very popular interactive command line interpreter, or shell. It has a very long history, starting with the first Unix shell, which was called the Thompson shell, in 1971.
What MAN does:
What MAN does, is show you what are called the manual pages, and they provide a comprehensive guide to almost any command that you can think of. You just press the Spacebar to page through. If you're feeling adventurous, you can press H, which brings up the reference for navigating around. And when you're done, just press Q.
example: man cd , man awk
Tilde and brace expansion:
Tilde : The tilde character represents the value of the user's home variable. The tilde followed by a dash or a minus represents the batch variable called old PWD, which is the directory that you were just in, if you've recently changed directories.
example: cd ~ , echo ~ -
Brace expansion: This is written with braces around an expression, and it can help with repeated commands with different terms or interpolation within a range
example: touch {John,Mike,Jake)
It would be a little tedious to touch each of those individually, so I can type touch, and then the beginning of the file name, file_, this can be whatever you want, 1..1000
example: touch file_{01..1000} , this will create 1000 files.
Brace expansion will interpret the range that you give it, so as an example, I said w..d, which is not only backwards, but it's also a subrange of the alphabet.
example: touch {John,banana,Jake}_{01...100}{w..d}
No comments:
Post a Comment