Compress unzip command: gzip (compress file, do not keep original file.) This command cannot compress the directory)Compression decompression command: Gunzip (unzip the. GZ zip file)Compression decompression Command: TAR (package compressed directory or unzip the compressed file. Packaging means to package a directory into a file, not the same as compression. The tar command can be compressed at the same time as the package, resulting in a. tar.gz file)Compression decompression command: ZIP (com
chmod [{ugoa}{+-=}{rwx}] [file or directory][mode=421] [File or directory]-R Recursive modificationExample: chmod g+w,o-r file or directoryBut generally with digital configuration permissions, example: chmod 766 files or directoriesChown User files or directories: Change the owner of a file or directory, only root can use the commandCHGRP User files or directories: Change the owning group of the file live directory, only root can use this commandUmask [-S] View the default permissions for the cu
Df-h user-friendly display file system partition informationNote: The directory in Linux is also a file, do not confuse the following directory file to say.The traditional way to view the file size can be used: ll-h/directory/file name, you can see the size of the file, but if you want to see the size of a directory, using the command: ll-h/directory, can only view the current directory information size, rather than the current directory of all the contents of the total file size occupied. For e
adm file1 #改变文件file1 belongs to the group ADM#其中ADM is a group already in the system. [Why change the user group, how to use the group?] Let's study later ...]4,umask/bin/umask # display, set default permissions for filesumask [-s]//-s Displays the new file or directory default permissions in rwx form, more intuitive e.g. Umask// View default permissions, compare traditional#显示0022 :0- special permission bit,022- user Rights bit [u,O], represents the mask value;Calculation: 777-022 = 755//
,g=rx,o=rx[[email protected] ~]# mkdir/tmp/test[[email protected] ~]# ls-ld/tmp/tes Tdrwxr-xr-x. 2 root root 4096 January 8 00:32/tmp/test[[email protected] ~]#when creating a new file, the default is no execute permission for security purposes . For example, create a new Test1.txt file under the TMP directory with the following default permissions:[Email protected] ~]# touch/tmp/test1.txt[[email protected] ~]# ls-l/tmp/test1.txt-rw-r--r--. 1 root root 0 January 8 00:34/tmp/test1.txt[[email
within 5 days" is find /-mtime-5 , find "5 days ago the day of the changed file name" is find /-mtime 5 , find "5 days ago changed file name" is Find/-mtime +5. We can see that there is no "+,-" difference is very big. Here is a diagram to illustrate: by this time axis we can know that the rightmost is the current time, + 5 Represents a file name that is greater than or equal to 6 days ago, 5 represents a file name that is less than or equal to 5 days, and5 is the file name that represents
: Using here doc to generate filesOutput:[Email protected] test]#Cat>log.txt EOF>Hello> World>Linux> pwd=$ (pwd)>Eof[[email protected] test]#ls-L Log.txt-rw-r--r--1Root rootPanax Notoginseng Ten- - -: -Log.txt[[email protected] test]#CatLog.txt helloworldlinuxpwd=/opt/soft/Test[[email protected] test]#DescriptionNote that the Bold section, here Doc, can be used for string substitution.Note:TAC (Reverse list)Command:TAC Log.txtOutput:TAC log.txt PWD=/opt/soft/TestlinuxworldhelloDescriptionThe TA
Common CentOS commands: find Common shortcuts
Common shortcuts
Ctrl + u: Clear ctri + k: Clear ctrl + d: leave the terminal when this action is null. If it is not empty, delete a character ctrl + h: delete the character ctrl + e before the cursor: Move to the cursor ctrl + a: move to the cursor ctrl + f: Move a charac
project path of Tomcat under WebApps, reflected to the rootDocker one-step installation RABBITMQDocker run-d--name rabbitmq--publish 5671:5671--publish 5672:5672--publish 4369:4369--publish 25672:25672--publish 15671:15671--publish 15672:15672 rabbitmq:managementNote: If the port is turned on, the firewall must have a custom port open under the server, and the security groupDocker installation RedisDocker run Redis--name redis-p 6379:6379-d redis-serverDocker installation NginxDocker Pull Nginx
directory from the remote directory via SSHTar CF-. | (cd/tmp/backup; tar xf-) copy a directory locally to another location, preserving the original permissions and linksFind/home/user1-name ' *.txt ' | Xargs Cp-av--target-directory=/home/backup/--parents Find and copy all files ending with '. txt ' from a directory to another directoryFind/var/log-name ' *.log ' | Tar CV--files-from=-| bzip2 > log.tar.bz2 Find all files that end with '. Log ' and make a bzip packageDD If=/dev/hda of=/dev/fd0 b
Common Linux commands and some common problemsCommon linux commands1. View Linux Version 1.1. View linux kernel version uname-r or uname-a1.2. view the linux kernel version cat/proc/version1.3. view the Linux host name hostname 2. Start or close the FTP service. vsftp start 3 view linux hard disk size df-lh4 view linux memory size free5 view CPU count ls/proc/acp
Label:Function: From_unixtime (Unix_timestamp,format) timestamp to string date format%M month name (January ... December)%W Week name (Sunday ... Saturday)%d The date of the month with English prefixes (1st, 2nd, 3rd, etc.). )%Y year, number, 4 bit%y year, number, 2 bit%a abbreviated weekday name (Sun ... Sat)Number of days in the month of%d, number (00 ...). 31)Number of days in%e month, number (0 ... 31)%m Month, number (01 ... 12)%c month, number (1 ... 12)%b Abbreviated month name (Jan ... D
BranchesGit branch-r# Start Tracking One remote branchGit branch--track some_branch origin/some_branch# Change to the branch locallygit checkout Some_branch# make changes and commit them locally....# Push your changes to the remote repository:git pushTo create a remote branch# Create a new branch locallyGit branch Name_of_branchgit checkout Name_of_branch# edit/add/remove Files # Commit your changes locallygit add fileNameGit commit-m Message# Push changes and new branch to remote repository
Common commands for creating and managing MySQL Databases:
1, use the show statement to find out what database currently exists on the server:
Mysql> show DATABASES;
2, create a database Mysqldata
mysql> CREATE DATABASE Mysqldata;
3, select the database you created
mysql> use Mysqldata; (press ENTER to appear when the database changed the operation success!) )
4, see what tables exist in the current
Tags: cron splay free head command watch Eid find more gzipThis article summarizes some of the most commonly used commands under Linux to keep up-to-date. The main learning resources are:1. "Brother Bird's Linux private cuisine-Basic article" Fourth edition2. "Linux is the way to learn"3. The total directory of Linux command series I have used4. Blog Park-a daily Linux command series5.linux command five-minute series6. Other Internet information, Goog
compression method (high compression ratio). The system default value is 6.Note: gzip cannot compress the entire directory. You can use tar to package first, then compressPsl long format output;U displays the process in the order of the user name and start time;J Use the task format to display the process;F to display the process in a tree-shaped format;A shows all processes of all users (including other users);X shows the process without control terminal;R shows the running process;WW avoids d
1 Viewing the default and supported storage enginesMysql->show engines;2 View MySQL's current default storage engineMysql->show variables like '%storage_engine% ';3 Viewing the storage engine for the test Database buyer tableMysql->show table status from test where name= ' buyer ';4 Modifying the table's storage engineMysql->alter table Buyer engine= ' InnoDB ';5 Backing up the database testAdministrator->mysqldump-uroot-padmin Test > D:/test.bake.sqlMySQL C
and display the type of files6. Nano New or Open file7, RM Delete-rf recursive not prompt to delete8, CP copy multiple source files to a target, if the target is a directory copy files to the directory, the file name does not change. If the target is a file, copy the file to the directory and rename the object to the target file name9. MV Cut File-F Overlay does not prompt================================================Text view1. Cat View File contents2, More/less3, Head/tailHead-n viewing the
Common centos commands are frequently used in our use. Therefore, we have thoroughly organized some frequently-used and important centos commands. The following describes common centos commands. I: use common centos
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.