linux: tar, apt, vim, gcc configure and simple to use

1 tar compression packages

  1.1 using gzip, bzip2, zip and unzip command, multiple files can be compressed folder where the document;

    The compression format is used linux .gz .bz2 and format, but gzip and bzip2 command compress only a single document, and not the folder where a plurality of document archiving packed into a compressed document;

# Format: gzip - [parameters] [to the target file] [from the original document] 
# effect: using gzip format compress the original file to the target file, the file is retained; 
gzip ac              # compressed ac file acgz, ac file are not preserved; 
-r dirzip gzip          # all file compression dirzip folder for .gz format, the file is retained, dirzip here or a folder, but the folder in the file compression; 
gzip -d acgz         # -decompress decompress acgz file to ac file, the file is retained; 
gzip -dr dirgzip        # decompress files in the folder dirgzip, the original document is not preserved;
# Format: bzip2 - [parameters] [destination file] 
# effect: bzip2 processing target file format; 
bzip2 the -Z AC           # the -Z: the compress, compressing ac> acbz2, does not retain the original document; 
bzip2 -d acbz2        # -d: decompree, decompression acbz2> ac, the original document is not preserved;
-rm test.zip dirzip ZIP         # -r recurse, the Remove -m, the dirzip folder compression is test.zip, and delete the original file 
the unzip test.zip               # decompress files test.zip

  1.2 tar packaging tool: tar tool provides packaged services while providing compression; (tar tool: to ... from ...)

# Format: tar - [parameters] [to the target file] [from the source file]
 
-v         # verbose display instruction execution
 
-c         # the Create Archive to create an archive that compressed files; 
-x         # Extract Archive archive decompression, ie decompression file ;
 
-j         # compressed to .tar.bz2 format; 
the -z         # compressed in .tar.gz format; 

-f         # file archive create archive;
# The -z .gzip format 
tar -vczf test.gz dirzip         # will dirzip folder to .gzip format, compression packaged as test.gz; 
tar -vxzf test.gz                # will test.gz folder to .gzip format, unzip ;
#   -J .bzip2 format 
tar -vcjf test.bz2 dirtest       # will dirtest folder to .bzip2 format, compressed test.bz2 
tar -vxjf test.bz2               # will test.bz2 .bzip2 file format, decompression;

2 APT tools: advanced packaging tool

  Action: Linux can connect to the server, the command to download the source code through apt, compiled into its own software, and installation;

Update-GET sudo apt            # compared with the package on the server, returns need to update the package 
sudo apt-GET the Check             # View dependencies local packages 
sudo apt-get install software name     # to download and install the software from the server 
sudo apt -get upgrade software name     # update the software from the server 
sudo apt-get remove the software name      # uninstall the software from the current system

3 VIM editor

  vim editor can edit operation has three modes;

  3.1 General Mode: Operation command inputs are mainly used to delete the content;

# Vim editor opens by default when a general mode, where keyboard input operation command 
X      # delete the character at the cursor; 
dd     # cursor to delete the contents of the line; 
YY    # copy the contents of the cursor line; 
NYY    # copy cursor downward SUMMARY row n; 
P      # paste content to below the cursor line; 
U      # a revocation operation before; 

R & lt      # replacement character at the cursor; 

# command is executed after completion of the operation command; automatic editing mode; 
I      # in front of the cursor input 
O      # below the cursor line input of a new row 
O      # new row entered above the cursor line 

S      # delete the character at the cursor, the cursor can be entered at the front 
CC     # cursor to delete the contents of the line, can be entered before the cursor

  3.2 Edit mode: Enter to edit the content of a document, press ESC to exit the input mode and return to normal mode;
        in edit mode vim, the cursor flashing in the current character, the character is input to the input before the cursor flashing ;

  3.3 line mode: Type in the normal mode ":", enter in the end line mode; press ESC to exit line mode and return to normal mode;

: w       # Save the document 
: q       # exit 
: the X-       # save the document and quit 
: q!      # do not save the document exit 
: / content is search     # search for specific content from the text, and then put the cursor in the search results at;

  3.4 Finally, to install and configure VIM editor

APT-GET vim the install the sudo    # install vim editor, vi command after installation is to use a text editor to edit vim; 
the sudo vi / etc / vim / the vimrc     # entering vim editor profile 

# end of the file, add the following settings, vim editor to configure; 
sET. 4 = TS              # set the tab to four spaces 
sET NU                # set vim display line numbers 
sET noexpandtab       # is not set using the spacebar    

VI main.c              # with vim editor to create a new file main.c and open

4 GCC compiler: (gcc tool ... from to ...)

  4.1 GCC compiler interface does not belong to the compiler, the compiler may be combined to make tools C under Linux;

# Format: gcc - [parameters] [to the target file] [from the original document] 
gcc hello.c                  # using gcc to compile hello.c file, the default links to an executable file a.out; 
gcc -o the Hello hello.c         # Use gcc compiler link hello.c file and modify an executable file named the Hello; 
gcc -c hello.c              # using file hello.c gcc compiler to generate hello.o object file, no link; 

. /a.out                      # executes the executable file a.out    

5 file system

  Under windows: FAT NTFS exFAT file system management;

  File systems under Linux there are ext2, ext3, ext4 and other file systems. Linux also supports other UNIX file systems, such as XFS, JFS, UFS, etc.
  Ubuntu supports multiple users, Ubuntu created a root directory for each user
 

Guess you like

Origin www.cnblogs.com/caesura-k/p/12626336.html