Linux Prophets and a few commonly used commands to speak in detail

Source: Internet
Author: User

Linux Prophet: Linux history:

I will not say more about this, in fact, is a very interesting story string, online to find a lot of.

UNIX-like system directory structure:

Ubuntu does not have the concept of a drive letter, there is only one root directory/, all files under it
   

Linux Directory
    • /: root directory, only directory under the general root directory, under Linux there is only one root directory. Everything starts here. When you enter "/home" in the terminal, you are actually telling the computer to start with the/(root directory) and then go to the House directory
    • /bin:/usr/bin: A directory of executable binaries, such as common commands ls, tar, MV, Cat, and so on.
    • /boot: Place some files used by Linux system startup, such as kernel files of Linux:/boot/vmlinuz, System Boot Manager:/boot/grub.
    • Dev: Store the device files under the Linux system and access a file in that directory, which is equivalent to accessing a device, which is commonly used to mount the optical drive mount/dev/cdrom/mnt.
    • /etc: the directory where the system configuration file is stored, the executable file is not recommended in this directory, the important configuration files are/etc/inittab,/etc/fstab,/ETC/INIT.D,/etc/x11,/etc/sysconfig,/etc/ Xinetd.d.
    • /home: The Default User house directory, add user account, the user's home directory is stored in this directory, ~ represents the current user's home directory, ~edu represents the user Edu home directory.
    • /lib:/usr/lib:/usr/local/lib: A directory of libraries used by the system, which requires the assistance of a function library to invoke some additional arguments during execution.
    • /lost+fount: When an error occurs with the system exception, some missing fragments are placed in this directory.
    • /MNT:/media: CD-ROM default mount point, usually the disc is mounted under/mnt/cdrom, or not necessarily, you can choose any location to mount.
    • /OPT: A directory for the host to install additional software.
    • /proc: This directory data are in memory, such as system core, external device, network status, because the data are stored in memory, so do not occupy disk space, the more important directory has/proc/cpuinfo,/proc/interrupts,/PROC/DMA,/proc /ioports,/proc/net/* and so on.
    • /root: Home directory for system administrator root.
    • /sbin:/usr/sbin:/usr/local/sbin: Place executable commands that the system administrator uses, such as Fdisk, Shutdown, Mount, and so on. Unlike/bin, these directories are commands for the root of the system administrator, and the average user can only "view" and not be set up and used.
    • /tmp: The directory where files are temporarily stored by the general user or the program being executed, accessible to anyone, and important data cannot be placed in this directory.
    • /SRV: The data directory that needs to be accessed after the service starts, such as the Web page data that the WWW service needs to store within/SRV/WWW.
    • /usr: The application holds the directory,/usr/bin stores the application,/usr/share stores the shared data,/usr/lib storage cannot run directly, but is necessary for many programs to run some library files. /usr/local: Store the software upgrade package. /usr/share/doc: System description file storage directory. /usr/share/man: Program description file storage directory.
    • /var: Place files that change frequently during the execution of the system, such as log files that change at any time/var/log,/var/log/message: All login Files directory,/var/spool/mail: Mail storage directory,/var/run: After the program or service starts, its PID is stored in the directory.
Several commonly used commands are spoken in detail:

A program ape may have heard of jokes. Said, a second-rate program ape with a computer in a coffee shop, see a beautiful woman, do sister eyes to see the place to open Ubuntu terminal, input, $>tree/ , and then (know that people certainly understand, do not understand the quick to try) ... The technique of picking up a recruit and chatting with her sister.

Linux commends generally have several parts: commends [-options] [Parameter1] ... , which is: command option parameter 1 ... (There may be multiple parameters, and there may be multiple options).

PWD: Displays the current path.

CD (change directory): Changes the current directory.

LS: Displays files or folders that are not hidden under the current folder.

    

ls -a                    displays all files and folders (including hidden).  ls -l                    is displayed as a list (size, no units in the list). the ls -h                    size is automatically displayed with units, such as 3.6K.  ls -a-l-hls -h-l-als -alhls -lha< c16/> above four operating effect.

  

commends--help/ Man commends : Displays the Help manual. Note: There are 8 man (Manuel) manuals.

mkdir foldername : Creates a new folder, followed by a folder name.

   mkdir /a/b/c/d/e-p : automatically creates a dependent folder, which is created automatically if it is not b,c,d.

 

touch filename : Create a file.

rmdir foldername : Only empty folders can be deleted. (rm = Remove)

RM -R foldername : can be recursively deleted folder, Action folder is restricted can try Plus, "-R": indicates recursion.

MV filename Destination address : (mv:move, the actual operation is cut meaning), move the file to the destination address.

mv filename newfilename : rename.

cp filename destadd : (cp:copy, copy), copy the file to the destination address.

CP foldername destadd-r : Copy folder to destination address, Action folder is limited can try Plus, "-R": indicates recursion.

history: Show all historical commands, and have a command label before. Use ! number! + the label of the corresponding command, equivalent to running the command.

cat filename : Can only view the contents of the file can not be edited, so it must be added that the file name is not the name of the folder.

More filename : The same is to view the contents of the file, but the former is displayed in the end, the latter is a split screen slowly display, controllable slowly view. Press "Q" exit.

 

LN -S object name Target name : A soft connection is established to the target and the object is deleted, the connection is invalidated.

Ln object name Target name : Make a hard connection to the target, delete the object, and the connection is still valid.

Principle.

grep "xxxx " Xxx.txt : Grep finds the content to find the target, showing all that contain "XXXX".

   grep "xxxx" xxx.txt-n : Displays the number of rows to find the target.

grep "xxxx " xxx.txt-v : Displays all target content except for "xxxx".

grep "^xxxx" xxx.txt : Displays all target content that starts with "XXXX".

grep "xxxx$" xxx.txt : Displays all target content ending with "xxxx".

  wildcard : Usually wildcard characters have?, *,[].

ls 2? : The only hint that starts with "2".

ls *2 : Displays all files and folders beginning with "2".

ls 1[123456]3. txt : Shows all 113.txt,123.txt ...

  Redirect: symbol >, >>

ls -alh > Xxx.txt : Save the content that will be displayed to the screen to Xxx.txt (overwrite the original data).

ls -alh >> xxx.txt : Save the content that will be displayed to the screen to Xxx.txt (in addition).

     

Two small shortcut keys to share:

1. First enter "Ctrl+alt+t" to enter the terminal quickly.

2. You may feel the word is too small, press "Ctrl+shift" and press "+" to enlarge the font, but to reduce the font is to press "CTRL" and then "-".

3. "Ctrl + C" is equivalent to not performing line breaks. Longer commands and input errors are easy to use.

Welcome to the guide.

Linux Prophets and a few commonly used commands to speak in detail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.