Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

(1) Linux basic description, basic commands and environment variables

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1 Linux distribution

Linux distribution (English: Linux distribution, also known as GNU/Linux distribution), for the general user pre-integrated Linux operating system and a variety of application software. General users do not need to recompile, after direct installation, only a small change in the settings can be used, usually with the software package management system to manage the application software. There are now more than 300 Linux distributions (list of Linux distributions). Most of them are in active development and are constantly improving.

Since most software packages are free and open source software, Linux distributions come in a variety of forms-from full-featured desktop and server systems to small systems (usually on embedded devices, or boot floppy disks). With the exception of some custom software (such as installation and configuration tools), distributions usually simply install specific applications on a bunch of libraries and kernels to meet the needs of specific users.

The popular distribution is based on Dpkg (Debian) commercial distribution Ubuntu, a very popular desktop distribution maintained by Canonical community distribution Debian, a system strongly believed in free software and maintained by volunteers, Kubuntu, using KDE desktop Ubuntu Linux Mint, Knoppix, a system derived from Ubuntu and compatible with Ubuntu, the first Live CD distribution Elementary OS, a derivative of OpenGEU,Ubuntu, a derivative of Debian, which can be run from removable media: based on Ubuntu, the interface is similar to Mac OS X gOS and other netbook systems based on the commercial version of Red Hat Enterprise Linux,Fedora, the commercial distribution of RPM (Red Hat family), openSUSE is maintained and provided by Red Hat, originally separated from Slackware, and now the Novell maintenance community distribution Fedora Is a community version of Red Hat that often introduces new features to test derivative versions of PCLinuxOS,Mandriva, a very popular distribution maintained by the community, a distribution developed from Red Hat, maintained by volunteers, designed to provide an open source and Red Hat 100% compatible system Mageia, and a distribution developed from Mandriva based on other package formats ArchLinux A rolling update operating system Chakra based on KISS (Keep It Simple and Stupid), a semi-scrolling update distribution Gentoo derived from ArchLinux and using only KDE desktops, a distribution for advanced users. The source code of all software needs to be compiled by itself. Slackware, one of the earliest distributions, was created in 1993, and 2 common Linux command formats are maintained by Patrick J. Volkerding.

Common command format of Linux system: command [options] [parameters]

The options start with -, and multiple options can be linked with one, such as ls-l-an and ls-la. Depending on the command, the parameters are optional or necessary.

The most important thing to use the linux command is to be able to use command help. Common command help includes:

1.man command (command help in the system manual)

2.info command (super detailed command help)

3.command-- help (command help within shell)

4.whatis (short command description)

5.apropos (online fuzzy search)

Linux command format example cat [root @ svr-75# cat-- helpUsage: cat [OPTION]. [FILE]... Concatenate FILE (s), or standard input, to standard output. -A,-- show-all equivalent to-vET-b,-- number-nonblank number nonempty output lines, overrides-n-e equivalent to-vE-E,-- show-ends display $at end of each line-n,-- number number all output lines-s -- squeeze-blank suppress repeated empty output lines-t equivalent to-vT-T,-- show-tabs display TAB characters as ^ I-u (ignored)-v,-- show-nonprinting use ^ and M-notation, except for LFD and TAB-- help display this help and exit-- version output version information and exitWith no FILE, or when FILE is- Read standard input.Examples: cat f-g Output f's contents, then standard input, then g's contents. Cat Copy standard input to standard output.GNU coreutils online help: For complete documentation, run: info coreutils' cat invocation'

The cat command is used to connect files and print to standard output devices. Use-- help to query the usage of the cat command. (since the documents are all in English, it is important to learn English well.)

An example that uses cat-n to show which line each line belongs to

[root@ansible-svr data] # cat welcomeThis is a test file.Welcome to the Linux World.Hope you have an amazing journey with me. [root@ansible-svr data] # cat-n welcome 1 This is a test file. 2 Welcome to the Linux World. 3 Hope you have an amazing journey with me.history

The history command of linux is used to record commands that have been executed.

Usage:

* history [n] n is a number, list the most recent n commands *-c eliminate all history commands in the current shell *-a write the newly added commands to histfiles, and by default write ~ / .bash_history*-r to the history memory of the current shell *-w write the contents of the current history memory to the histfiles

The history command can modify the output format. Here is the normal output format:

[root@ansible-svr ~] # history 1 history

The number represents the first history record, and if we want to change the output format now so that it shows the time, we can use the following command:

HISTTIMEFORMAT= "F T"

Let's take a look at the output of history. "

[root@ansible-svr] # history 1 2019-11-01 01:32:24 history 2 2019-11-01 01:34:24 HISTTIMEFORMAT= "% F% T" 3 2019-11-01 01:34:27 history

But the use of this command can not be saved permanently, the exit environment will not take effect next time, how to make it permanent. At this point, you have to configure permanent environment variables.

3 Environmental variables

The above example represents a temporary change to the environment variable, so how to change the environment variable permanently.

Profile file: modification / etc/profile (valid for all users) # vi / etc/profile add: export PATH= "$PATH:/home/xyz/Tesseract/bin" bashrc file: modify ~ / .bashrc file. (available in each user directory, ls-all, valid for individual users) cd ~ vi .bashrc adds: export PATH= "$PATH:/opt/au1200_rm/build_tools/bin" to it.

The permanent setting method generally requires a re-logout of the system to take effect.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report