linux preliminary study (4) Other instructions


1. The global regular expression search

Filtered search can be regular expression matching
command: grep (Global Regular Expression Print)
    Format: grep [option] pattern filenames
    functions: search the designated row or the standard input file and display each line of pattern matching.
    Options: -i ignore case when matching
           -v looking for patterns mismatch line
    ps -ef | grep svn find the corresponding command

         
2.ls listed in the file

ls -a to list all the files in a directory, contains Start hidden file
ls -A except listed. Other documents and ..
ls -r reverse order
ls -t file modification time to sort
ls -S file size to sort
ls -h to-read display size
ls -l in addition to the file names, permissions, owner, file size and other information will be detailed in documents

Create a file 3.mkdir

Create a folder
available options:
-m: to create a new directory to set access rights can also be set with the chmod command;
-p: can be a path name. At this point, if some of the directory path does not yet exist, after adding this option, the system will automatically build a good directory of those not yet in, that one can create multiple directories;
Example:
Create a named under (1) the current working directory t folder
           mkdir t
(2) create a path tmp catalog of test / t1 / t directory, if present, is created

         mkdir -p /tmp/test/t1/t

4.tar compression / decompression command

-c create a new compressed file
-f archive specified
-r already add files to files in archive
-u changed and added to the existing file compressed package
-x extracted from the archive file
-t display compressed file content
-z support gzip compression
-j bzip2 compression support
-Z support compress decompress files


tar -cvf archive.tar file1 create a non-compressed the tarball
tar -cvf archive.tar file1 file2 dir1 created containing a 'file1', 'file2' and 'dir1' archive
tar -tf archive.tar a display package content
tar -xvf archive.tar release a package
tar -xvf archive.tar -C / tmp to release the compressed packet / tmp catalog
tar -cvfj archive.tar.bz2 dir1 create a compressed format bzip2
tar -jxvf archive .tar.bz2 decompress a bzip2 compressed format
to create a gzip format tar -cvfz archive.tar.gz dir1 compressed
tar -zxvf archive.tar.gz a gzip-extracting archive format

5. Other commands

See current path pwd
free display system memory usage, including physical memory, interaction zone memory (the swap) and the kernel buffer memory.
sudo rm -rf folder delete a folder name

 

 

Guess you like

Origin blog.csdn.net/weixin_42208646/article/details/91411991