Skip to content
Snippets Groups Projects

Bash tutorial

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Kiryuu Sakuya

    By freecodecamp

    Bash.txt 882 B
    echo $0 -> Current terminal program
    pwd -> Print work directory
    mkdir, rmdir -> Create/Remove dir
    touch -> Create a new file
    cp, mv -> Copy / Move
    cat -> ConcAtenaTe "link (things) together in a chain or series." 把...连接起来
    
    vi have two modes: insert & command
    i -> --insert--
    
    Get out: <ESCape> -> :wq (Safe & Quit)
    
    .bash_profile is executed for login shells (have authentication tokens)
    
    if [-f ~/.bashrc]; then
        source ~/.bashrc
    fi
    
    This is making sure we only are sourcing the bashrc from the bash_profile.
    
    export CLICOLOR=1
    # CLICOLOR enables coloring of your terminal
    export LSCOLORS=GxFxCxDxBxegedabagaced
    # LSCOLORS specifies how to color specific items
    
    .bashrc is executed for interactive non login shells (general configuration)
    
    clear -> fresh start!
    
    Ctrl + C -> Exit an operation or program.
    
    Write a script!
    
    #!/bin/bash
    clear
    echo "Good morning, world."
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment