Bash Basics - miraj/tools GitHub Wiki

Daily Shell

  1. Command History
    • history command
    • Browsing History using arrow keys
    • ctrl-R : to search in the history
  2. !$ - for using the previous argument
  3. echo
  4. .bashrc
  5. ls
    • ls -l
    • ls -lcrt
    • ls *.pl
    • ls *.p[lm]
    • who expands * to the filenames? ls command? or the shell?
  6. Multiple commands in a single line
  7. pipe
  8. environment variables
    • PATH
    • HOME
    • HISTFILESIZE
  9. cat, tail, head
  10. > redirecting to a file
  11. wc
  12. find
  13. locate, updatedb
  14. man command, man pages
  15. Soft Links
  16. tail
  17. File System
    • Access Rights
    • user, group, others
    • chmod, chown

Towards Scripting

  1. Single quote and double quote
  2. special charactors : *, $, [,]', , ", `
  3. Command Terminators
    • newline
    • ;
    • &&
    • ||
  4. Escape character
  5. bg, fg, ctrl-Z, ctrl-C
  6. grep
    • grep -i
    • grep -r
  7. Variables
    • setting
    • viewing
    • scope
  8. export. Why is it needed?
  9. sed, awk

Advanced Shell Scripting

  1. Arguments to a shell script: $0, $1, $2
  2. $#, $*
  3. Variables, export
  4. Shell Scripts are executed in a subshell
  5. source command. Why is it needed?
  6. lists
  7. if condition. if, fi
  8. for
  9. seq : iterating over numbers
  10. Iterating over lines
  11. procedures and arguments
  12. redirection
  13. redirection in for loop
  14. Creating a block
  15. redirection from a block.
⚠️ **GitHub.com Fallback** ⚠️