Linux basic commands

Source: Internet
Author: User
Tags redmine

1, view current directory: PWD

2, switch folder: CD destination folder relative path

3, view catalog: ls

4. View directory and file permissions: LL

5, edit a file: Vim file name = "Press the key i=" A, after editing quit do not save press ESC, then:, then press Q, and then press! , then press ENTER to Save: Wq (Save exit Yes: Wq do not save exit is: q!).

6, Reverse View files: Tail file name

7. View a file: Cat file name

8, view script Portal Shell file on server: crontab-l (sudo+ target command can switch account to root)

9, Edit Script entry Shell file on server: CRONTAB-E

10,nginx modified to see whether the syntax is correct: nginx-t

11,nginx Restart: Service Nginx reload or nginx-s reload

12, find mysqldump command: Whereis mysqldump

When the mysqldump command is invalid

Find The path of mysqldump with a find command first

Find/-name Mysqldump-print

then use the ln command to link to /usr/bin below

Ln-fs/usr/local/mysql/bin/mysqldump/usr/bin

Note /usr/local/mysql/bin/mysqldump to the path that you just exported

Ln-fs /usr/local/webserver/mysql/bin/mysqldump /usr/bin



13, the server command line accesses mysql:a,mysql-hhostname-uusername-p B, press ENTER, then enter the database password, then query the database show databases, and then select the database before doing the operation on the database. use databases;, view slow statement show Processlist;, See variables for a class of strings show global variables like '%lock% ';

Exit MySQL mode exit;

14, BACKUP database: Mysqldump-uusername-p database name >. sql

back up some tables mysqldump-h hostname-u username-p databasename table1 table2 > Db.sql

15. Backing up and packaging the database (gzip limited to Linux systems):

Mysqldump-h hostname-u username-p DatabaseName | gzip > db.sql.gz

16. Find a software: Find/-name software name

17,windows start Redis: Go to Redis folder Redis-server.exe redis.conf, clean up Redis cache redis-cli, view all cache keys*, empty flush db, get hash value Hgetall key name, get value get key name

18, look for a curl:php-m|grep curl on the server, view all installed extensions php-m, view the system uname-m, view the server system uname-a

19,redmine restart: sudo thin start-c /var/www/redmine/redmine.yml

20,sql: Date converted to timestamp Unix_timestamp () Timestamp converted to date from_unixtime ()





This article is from the "11427420" blog, please be sure to keep this source http://11437420.blog.51cto.com/11427420/1878620

Linux basic commands

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.