• 周六. 10 月 12th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

Common commands in Linux (1)

King Wang

1 月 3, 2022

One . Command parser

    shell—unix operating system

    bash—linux operating system

Explain the execution of commands that can be executed by the terminal

The essence : According to the name of the executable program

 

Two .history Command display history execute command

    CTRL+p Upward search

    CTRL+N Find down

    CTRL+B The cursor moves forward

    CTRL+F  The cursor moves back

    CTRL+a  The cursor jumps to the beginning of the line

    CTRL+e   The cursor jumps to the end of the line

    tab The key is an auto completion key

 

3、 … and .Linux The directory structure of the system

 

       

   

     

/bin

            yes binary Abbreviation , This directory holds the most frequently used commands

   

/boot  

        Store start linux The core files include some image files and connection files

 /dev 

       dev when device Abbreviation for equipment , This directory holds linux External equipment of , stay Linux The way to access the device is the same as the way to access the file .

/etc

        This directory is used to store all system management configuration files and directories

/home  

      User’s home directory , stay Linux Each user in has its own directory , Generally, the directory is named after the user

/lib

    This directory holds the most basic dynamic link sharing library of the system , Its function is in Windows Medium DDL file

/lost-found

    This file is usually empty . When the system is shut down illegally , There will be some files here

/media

     linux The system will automatically work on some devices , Such as u Disk drive , When identified ,Linux Will mount the identified device to this directory

/mnt

    The system provides this directory for users to temporarily mount to the file system We can mount the optical drive to /mnt Then enter the CD-ROM drive to view the contents of the CD-ROM

/opt

    This is the directory where additional software is installed on the host computer , For example, you install a oracle Database to this directory . The directory is empty by default .

/proc

 

    This directory is a virtual directory , It’s a mapping of system memory , We can access , This directory to get information about the system

    The contents of this directory are not on the hard disk, but in memory , We can directly modify the files inside , For example, use the following command to block the host ping command , Make it impossible for others to ping Your machine

echo  / > /proc/sys/net/ipv4/icmp-echo-ignore-all

/root 

      This directory is the system administrator directory , Also known as the super privilege user home directory

 

/sbin

     s Namely super user It means , Here is the system administrator’s program

/usr 

      This is a very important Directory , Many of the user’s applications and files are stored in this directory , Be similar to windows Under the program files Catalog

/usr/bin

    Applications used by system users

/usr/sbin

    At first, users used more advanced management programs and system daemons

/usr/src

    The default placement directory for kernel source code

/var

    This directory contains constantly expanding things, and we are used to putting those directories that are often modified in this directory , Including various log files

 

 

 

 

          stay Linux in , There are several catalogues that are more important , Don’t delete by mistake

               /etc    It’s the system configuration file

               /bin     /sbin    /usr/bin    /usr/sbin: The default location directory of the execution file

              /bin    /usr/bin  Is an instruction for system users

              /sbin   /usr/sbin   It’s for root Instructions used by the user

              /var It’s a very important Directory , Many important programs running on the system will be stored in /var/log Under the directory, for example mail Program

 

         Four . User directory

 

                        Relative paths     The file location relative to the current directory

                          . Current directory

                          ..  Upper level directory

                          cd  _  Two adjacent directories switch

                          Absolute path     Starting from the root directory

 

 

                          # On behalf of super users  

                              

 

                         $ On behalf of ordinary users

                            

 

5、 … and .ls and tree Use

            

 

tree The command must be networked to install the command

              

Must be in root Permission to install

Examples are as follows :

 

 

6、 … and . The color of files and directories

white Ordinary documents
Blue Catalog
green Executable file
Red Compressed files
Cyan Link to the file ( similar windows Next shortcut )
yellow Equipment department documents ( In general dev Under the table of contents )
gray Other documents
   

 

7、 … and .ls command

ls -a 

 

Show all the documents , Include hidden files similar to   . file In this case, the file is hidden

 

linux Hidden files and folders under ( Catalog ) Need to use mv command 、 In fact, it’s very simple .

Example : take a Catalog hidden

command :mv a .a

 

Type of file

              

Catalog d
Ordinary documents
Link symbols l
Block device b
Character device c
socket file s
The Conduit p

 

r —read jurisdiction

w—-write jurisdiction

x—– Executive authority

 

  This analysis is

 -rw-rw-r– 1 kong kong 0 otc 29 22:56 a.txt 

– For file type

rw- The authority of the owner

rw- Permissions for the same group of users

r–  Authority of others

1 The number of links to the file

kong The owner of the file or directory

kong The file or directory The group to which it belongs

otc 29 22:56    Last update date of the document

a.txt file name

 

 

 

 

 

          

 

 

 

 

 

           

 

 

 

 

 

 

 

 

 

   

 

 

 

发表回复