Common commands in ubuntu linux

Source: Internet
Author: User

1. All permissions for folders and subfolders: chmod-R777test, generally 755 is enough
2. Folder name
Go to the folder to copy all files to the destination folder: rsync-Cavz * brantx@abc.com:/var/www/jtbc/img
Scp-r * brantx@abc.com:/var/www


3. modify the system time:

Method 1:
Date010318242008 (month, day, and year)
Date010318242008.30 (YYYY. Sec)

Method 2: set the date first
Date-s20080103
2. Set the time
Date-s18: 24: 00,
If you want to change the BIOS time at the same time
Run again
Clock-w


4. Search for files containing text
Find./-typef-name "*. php"-execgrep-l "58.211.115.53" {}\;>/file_list.txt

5, tar packaging and compression: tar-zcvftest.tar.gztest, decompression: tar-zxvftest.tar.gztest/
6, *. gz decompression: gzip-dtest.gz
7. view the folder size: du-shtest
8. mount a hard disk or USB flash disk device: first, go to the/dev directory to find the files named sda1 and sdb1, indicating that the hardware has been loaded, and then mount the device: mount/dev/sda1/mnt
9. log on to other linux servers: ssheteet@eteet.com
10. mysql in linux:
A. login mysql: mysql-uroot-p (local login); mysql-h192.168.0. ***-uroot-p (login to other machines)
B. Back up a mysql database and compress the name by Time: mysqldumpbtoss-uroot-p114114 | gzip>/backup/btoss-((datepolicpolicpolicypolicm1_d1_.gz
C. view the database: showdatabases;
D. Use a database: usebtoss;
E. View All Tables: showtables;
F. view the table structure: desctablename;
E. Modify the root user password: mysqladmin-uroot-ppasswordasdfjkl;
11. find the file by time./-mtime-1 | more;-1 represents a few days,./Represents the Directory
Eg. find./-ctime-1-execcp {}/bak \; indicates to find the file from the previous day in the current directory and copy it to the bak directory. Note the format semicolon)
12. Add a virtual IP Address: ifconfigeth0: 0172.16.7.100netmask?255.255.255broadcast172.16.7.100 to an Eni.
Add two virtual IP addresses: ifconfigeth1: 0172.16.7.101netmask1_255.255.255broadcast172.16.7.101
Delete the added virtual IP Address: ifconfigeth0: 0del172. 16.7.100
13. ipvsadm application:
A. Deletion record: ipvsadm-d-t172.16.7.207: 80-r172.16.7.209: 80
14. Add User in linux: adduserjoe, password change: passwdjoe, delete user: userdel-fjoe
15. system update time: ntpdatentp.ubuntu.com
16. Extract rar files: apt-getinstallunrar,raretest.rar
17. Batch delete files of a specified size in a directory find.-name '*'-typef-size1024 | xargs-n1rm-f
18. Use the vi editor to replace all the words "asdf" in the file with "AACC": s/asdf/AACC/g.
19. iptables configuration instance reference: http://www.linux.gov.cn/netweb/iptables.htm#iptablesexample
20. Use wireshark to open the tcpdump-ieth0-s0-wtcp.cap for packet capture in linux
21. view the real-time network speed. Look at the downlink: nload-uH, and see a NIC: iptraf-g.
22. Hard Disk Partitioning in linux: fdisk/dev/sdb
Prompt all help by m
Display the current partition by p
Delete the current partition by d. You may need to select the ID of the current partition.
Press n to create a new partition. The following message is displayed: Primary p, e extension. Select primary Partition Number 1-4. The default value is 1. Start next to select the boiling surface size. The default value is 1.
Save by w
23. format it to Ext3: mkfs. ext3/dev/sdb1
24. Enable automatic mounting of the hard disk: Modify/etc/fstab to add/dev/sdb1/dataext4errors = remount-ro01

This article is from the "lly0205.mofile.com" blog, please be sure to keep this source http://481814.blog.51cto.com/471814/1301590

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.