Linux Learning Notes

Source: Internet
Author: User
Tags clear screen unpack

1. ctrl+alt+enter: You can make the virtual machine full screen.

2. Tab key : command and directory completion. Click Auto-Complete, and double-click to list all commands or directories that you can complete.

3. CD: Change Directory

Simplified:CD ~ (or CD ) enters the current user's home directory (that is, the user's environment directory, such as the root user's/root,student user's/home/student directory)

CD- go to last directory

     CD.. Go to the top level directory

     CD. Go to current directory

4. ctrl+l: Clear Screen

5. pwd: print working directory print the current directory.

6. rmdir: remove empty directories can only be deleted

7. RM-RF [catalog file]: remove- r: Delete directory- f: Mandatory Note: once deleted, unrecoverable

8. CP [Options] [Original file or directory] [target directory]: copy

  - R: Copy directory- p: File attributes copy- D: If the source file is a linked file, Copy the Link property-a: equivalent to the -pdr combination (that is, copy all the information of the original file , including time and other attributes are identical to the source file)

9. MV [Source files or directories] [target directory]: move cut or change names (source and destination files are not cut in the same directory, change names in different directories)

Ten. ls-l and ll .

11. The role of common directories

You can put content in your home directory /root or/////////.

  / root directory

  The /bin command saves the directory (commands that a normal user can read) bin is the command of a normal user, andsbin is the command directory of the Superuser. It's all saved system commands.

   /boot directory to start related files

  / Dev device File save directory

  / etc configuration File Save Directory

   Home directory for normal users

  /lib System Library Save Directory

  /mnt System mount Directory

  /media Mount Directory

  /root home directory for super users

  / tmp Temp directory

  /sbin command to save directory (a directory that can be used by super users)

  /proc and /sys are written directly into memory (typically not, because writing data directly into memory can cause memory to become stuck). Cannot be manipulated directly, these two directories hold the memory overload point.

  / usr system software Resources Directory

    /usr/bin System command (normal user)

    /usr/sbin system command (super User)

  / var system related document content

12. Link command: ln

ln-s [Original file] [target file]: link-s: Create soft link

No-S is a hard link, a hard link is equivalent to two variables that refer to the same address, one variable is not, and the other variable can find the address.

Soft link is equivalent to wondows desktop shortcut keys, when the source program is deleted, the link is not on.

13. Search

File Search command: locate: Search in the specified database (folder), fast, but the newly created may not search, to search for the first to perform the update:updatedb

File Search command: find: Full search, resource-intensive and time-consuming.

such as:find/root-name "win*" ; There are *, [],? wildcard characters.

            find/root-iname "win*" ; -I is case insensitive

            Find/root-user root ; According to the owner search, it is commonly used:find/root-nouser No owner of the file, that is, junk files.

            find/var/log/-mtime +10 ; +10 Find files modified within 10 days, 10 Find files modified in 10 days,-10 Find Files modified 10 days ago.

               atime: File access time,ctime: Change file properties,mtime: Modify the contents of the file.

            find/root-size 25k ; Find files with a file size of 25KB. -25k less than 25kb,+25 greater than 25KB.

            find/root-inum 262422 ; Find the I node is a 262422 file.

            find/etc-size +20k-a-size-50k //In the/etc/directory, files larger than 20KB and less than 50KB.  -a:and; -o:or

            find/etc-size +20k-a-size-50k-exec ls-lh {} \; Find and display. -exec Command {} \; : Performs the "command" action on the search results.

Such as: can find a file, and then directly delete:find/etc-size +20k-a-size-50k-exec rm-rf {} \;

Command Search command: whereis and which: Whereis can only find the location of the system command and the location of the Help document (for example:whereis ls);which you can see where the command is located and where the alias is located (with an alias)

String Search command: grep. grep [Options] string file name matches a qualified string in a file- I: ignore case -V: queue specified string

  The difference between the find command and the grep command:

    Find Command: Searches the system for eligible filenames , and if matching is required, wildcard matches are used, wildcards are exact matches (that is, the filenames are identical or use wildcards *?). []).

grep Command: Searches the file for qualifying strings , matches with regular expressions if required, and regular expressions contain matching strings.

14. Compression: Common compression formats: . zip, . GZ,. bz2 (compressed file names are typically appended with a compressed format suffix, such as: Text.zip)

      . zip: Compressed Files: Zip compressed file name source file Compression directory: zip-r Compressed file name source file extract: Unzip compressed files /c13>

.gz :   compressed file: gzip source file   (source files will disappear)    gzip-r directory   (all sub-files under the compressed directory, but not the directory)    Unzip file: gzip-d compressed file and gunzip

      . bz2: Compressed files: bzip2 source files (do not keep source files) bzip2-k source files (keep source files after compression) Note: The BZIP2 command cannot compress the directory. Unzip the file: bzip2-d Compressed files and Bunzip2 compressed files (-K reserved Compressed files)

Commonly seen compression format ( multi-use ): . tar.gz,. tar.bz2

Package Command tar: TAR-CVF Package file name source file- C: Package-V: Display procedure-F: Specifies the file name after packaging such as: TAR-CVF Test.tar test

Unpack command: TAR-XVF package file name -x: Unpack as: TAR-XVF test

tar.gz :   TAR-ZCVF Compressed package name. tar.gz source file   -z: Compressed to. tar.gz format       Unzip: TAR-ZXVF compressed package name. tar.gz   -x: Unzip. tar.gz format

. TAR.BZ2:TAR-JCVF compressed package name. tar.bz2 source file- Z: Compressed to. tar.bz2 format decompression: TAR-JXVF Compressed package name. tar.bz2 - x: Unzip. tar.bz2 format

shutdown Command: shutdown [option] Time -C: Cancel previous shutdown command-H: Shutdown-r: Restart

Other shutdown commands: Halt, Poweroff, Init 0

Other restart commands: Reboot, init 6

Exit Login Command: Logout

16. View logged in User information: W user name, who username

Querying user information for current login and past logins: last

    

View last login time for all users: Lastlog

    

The shell is actually the equivalent of a translator between a person and a computer, translating instructions into a computer-literate binary code. The graphical interface in Windows and the Doc Command Prompt window can actually be said to be shell.

    

Linux does not differentiate file types by extension name

Compressed package: "*.gz", "*.bz2", "*.tar.bz2", "*.tgz", etc.

Binary package: ". RPM"

Web files: "*.html", "*.php"

Script file: "*.sh"

Configuration file: "*.conf"

19. Output command: echo

Viewing and setting aliases: alias and alias alias = ' original command ' delete alias: unalias

Historical command: history

Show current date and time: date

Change your own key: passwd

Show file type: Files

Displays the beginning and end of a file with 10 lines of content,-n+ numbers to specify the number of lines: head and tail

Number of rows, children, and characters in the statistics file: WC Parameters:-L,-W,-C

20.

21st.

22.

  

23.

  

Linux Learning Notes

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.