Linux command line daily use technology

  

Some people say that the Linux command line is an art, the architecture of the Linux system formed by the command line presents a rich and varied appearance, which is the charm of Linux. This article will introduce the daily use of the Linux command line.

curl -s ‘https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md’ |  Egrep -o ‘`\\w+`’ |  Tr -d ‘`’ |  Cowsay -W50

Using the command line smoothly is a frequently overlooked skill, or is considered a mysterious mystery. However, it will improve your flexibility and productivity as an engineer in a clear and subtle way. This is the quintessence of useful command line tips and notes I found when working on Linux. Some tips are very basic, while others are quite special, complex, or obscure. This article is not long, but if you can use and remember everything here, then you know a lot.

Most of them first appeared on Quora, but considering the interest, it seems that they should be placed on Github. People here can propose improvements better than me. If you see an error, or something better, please submit a question or PR! (Of course, please read the required section and the existing PR/Issue before submitting.)

Required Reading

Scope:

This article is for beginners and professionals. The goal of the topic is to cover a wide range (all are important), to be targeted (in most cases give concrete examples) and to be concise (avoid unnecessary content and digressive content that you can easily find elsewhere). Every trick is necessary in some situations, or it can save a lot of time compared to alternatives.

This is written for Linux. Most of the entries can be applied to MacOS (or even Cygwin).

Primarily for interactive Bash, although most tips can be applied to other shells as well as regular Bash scripts.

includes the "standard" "UNIX commands and those packages that need to be installed (they are important and worth installing).

Note:

In order to be able to display as many things as possible in an article, some specific information will be placed on the reference page. You can use Google to get further content. (If needed) You can install these new programs using apt-get/yum/dnf/pacman/pip/brew.

Use Explainshell to get an explanation of commands, parameters, pipes, and more.

Basics

Learn basic Bash skills. In fact, type man bash, and then at least browse through all the content; it's easy to understand, not that long. Other shells are fine, but Bash is powerful and can be found everywhere (if you only learn zsh, fish, etc. in your own laptop, it will be limited in many situations, such as when using an existing server).

Learn at least one text-based editor. The ideal one is Vim(vi), which can be found at any time during editing in the terminal (even though most of the time you are using Emacs, a large IDE, or a modern, funky editor).

Learn how to use man to read the documentation (curiously, use man man to list partition numbers, such as 1 for regular commands, 5 for file descriptions, and 8 for administrators). Use apropos to find the help page. Know which commands are not executables, but Bash is built in. You can get help with help and help -d.

Learn to use and "for output and input redirection, and use |  Come to the pipeline to redirect and learn about stdout and stderr.

Learn * (and maybe ? and {...} ) file wildcard extensions and applications, and the difference between double quotes “ and single quotes ‘. (See the variable extension section below for more details).

Familiar with Bash job management: &, ctrl-z, ctrl-c, jobs, fg, bg, kill, etc.

Master ssh and basic skills without password verification via ssh-agent, ssh-add, etc.

Basic file management: ls and ls -l (in particular, know the meaning of each column of ls -l), less, head, tail and tail -f (or better less +F), ln And ln -s (know the difference between hard links and soft links, and the advantages of hard links versus soft links), chown, chmod, du (a quick summary for viewing disk usage: du -sk *). File system management: df, mount, fdisk, mkfs, lsblk.

Basic network management: ip or ifconfig, dig.

Familiar with regular expressions and various options for using grep/egrep. The -i, -o, -A, and -B options are worth mastering.

Learn to use apt-get, yum, dnf or pacman (depending on your distribution) to find and install packages. Make sure you can use pip to install Python-based command line tools (some of the following can be easily installed via pip). Previous123456Next page Total 6 pages

Copyright © Windows knowledge All Rights Reserved