Skip to content

rafaleao9923/bootcamp-learn-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootcamp learn linux

Table of Contents

Course Outline

Setting Up the Environment

Linux Distributions

  • Linux distributions, often referred to as "distros," are variations of the Linux operating system that include the Linux kernel, system libraries, system utilities, and application software.
  • Each distribution is a complete package that can be installed on a computer, server, or embedded device.
  • There are hundreds of Linux distributions, each catering to specific needs and preferences.

The Linux Terminal in Depth

Getting Help, Man Pages (man, type, help, apropos)

man, type, help, and apropos are all commands used in Unix-like operating systems to help users understand and use other commands.

Linux Command Structure

  • commands are the instructions given to the operating system to perform specific tasks.
  • The typical structure of a Linux command is as follows:
command [options] [arguments]

Terminal - Keyboard Shortcuts

Navigation Shortcuts:

Text Manipulation Shortcuts:

Command History Shortcuts:

Terminal Multiplexer (tmux) Shortcuts (if tmux is installed):

Copy-Paste Shortcuts (when using a terminal emulator that supports them):

Mastering the Terminal - the Bash History

  • The Bash history is a useful feature in the Bash shell that keeps a record of the commands you've entered during your session.
  • It allows you to review, reuse, and manage your command history efficiently.
  1. Command History Size:

    • The number of commands stored in the history can be set using the HISTSIZE environment variable. For example:
      export HISTSIZE=1000
  2. History File:

    • The history is usually saved to a file called .bash_history in the user's home directory.

Commands for Interacting with the History:

  1. history Command:

  2. !! (Double Bang):

  3. !n (History Expansion):

  4. !-n (Relative History):

  5. !string (Search and Execute):

  6. Ctrl + R (Reverse Search):

  7. history -c (Clear History):

  8. history -d n (Delete Entry):

Customizing the History:

  1. HISTCONTROL Variable:

  2. HISTFILE Variable:

  3. HISTTIMEFORMAT Variable:

Tips and Tricks:

  1. Persistent History Across Sessions:

  2. Ignore Commands from History:

  3. Execute a Command Without Saving to History:

Mastering the Terminal - The TAB Key

The TAB key is a powerful tool in the Linux terminal, providing various functionalities to ease command-line usage. Here's an in-depth look at the uses of the TAB key in the terminal:

1. Auto-Completion:

  • One of the primary functions of the TAB key is auto-completion. When you start typing a command, file, or directory name and press TAB, the terminal will attempt to complete the entry based on the available options.
    ls Do<TAB>
    # Result: ls Documents/

2. Auto-Completion for Commands:

  • Pressing TAB after typing a partial command will attempt to complete it, helping you avoid typing the full command.
    su<TAB>
    # Result: sudo

3. Auto-Completion for File and Directory Paths:

  • Auto-completion works for file and directory paths, making it easier to navigate the filesystem.
    cd /ho<TAB>
    # Result: cd /home/

4. Auto-Completion for Filenames with Spaces:

  • If a filename contains spaces, the TAB key will automatically escape the spaces, allowing you to continue typing.
    cat My\ Docu<TAB>
    # Result: cat My\ Documents/

5. Listing Available Options:

  • Pressing TAB twice after a partial entry will display a list of available options, helping you choose from the available matches.
    ls D<TAB><TAB>
    # Result: Display list of options starting with D

6. Auto-Completion for Command Options:

  • When typing command options, pressing TAB will auto-complete the option if there is a unique match.
    ls -l --h<TAB>
    # Result: ls -l --help

7. Auto-Completion for Variable Names:

  • In some shells, pressing TAB can auto-complete variable names.
    $MY_VA<TAB>
    # Result: $MY_VARIABLE

8. Auto-Completion for Environment Variables:

  • Environment variables can be auto-completed by pressing TAB after the $ symbol.
    echo $HOM<TAB>
    # Result: echo $HOME

9. Command Substitution:

  • When using command substitution with $(...), pressing TAB can auto-complete the command within the substitution.
    ls -l $(echo /u<TAB>)
    # Result: ls -l $(echo /usr/)

10. File and Directory Listing:

  • Pressing TAB after a command that expects a file or directory as an argument will list available options.
    cat /etc/p<TAB>
    # Result: cat /etc/passwd

Tips:

  • Double-Tap TAB:

    • Double-tapping TAB will show a list of available options if there are multiple matches.
  • Cycle Through Options:

    • If there are multiple matches, pressing TAB multiple times will cycle through the available options.
  • Case Sensitivity:

    • TAB key completion is case-sensitive. Be aware of the case when using it.
  • Customization:

    • The behavior of TAB completion can be customized using shell options and configuration files, such as .bashrc or .bash_profile.

Recording the Date and Time for Each line in History

root vs. non-Privileged Users

Running Commands Without Leaving a Trace

Terminals, Consoles, Shells and Commands

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages