Linux Common Command Usage 100

Source: Internet
Author: User
Tags arithmetic clear screen mysql in php mysql sort split root directory backup

Here are 100 uses, what's wrong, and please correct me.

1,echo "AA" > Test.txt and Echo "BB" >> test.txt//> Empty the original file and write the contents to the file,>> place the content at the end of the file

2,chmod go+w-r/home/zhangy//To add Write permissions to group users and other users

3,TAR-TZVF test.tar.gz//listing of archived content

4,du-ah//view file list size

5,du-sh//View total size of all files

6,echo ' 1+2 ' |bc-l/mathematical operations

7,UNAME-A//View some information about Linux kernel and so on

8,badblocks-s/DEV/SDA//Bad Channel scan show progress

9,time command//view run time

10,LS-LRT//reverse ORDER by time

Show progress when 11,rsync-p//sync

12.history-c//Clear History command

13,CD-//back to last Catalog

14,tree//Display directory tree

15,umount-n/mnt/hda2//Forced Uninstall

16,echo ~///display user's home directory

17,echo $[5*5]//arithmetic operations

18,echo $ ((5*5))//arithmetic operations

19,eval ls;ps aux|grep httpd//All two commands can be executed

20,free-m//MB per unit display memory

21,uptime//Shows how long the system has been running, which displays the following information in turn: How much time is now, how long the system has been running, how many users are currently logged in, the system's average load in the last 1 minutes, 5 minutes, and 15 minutes

22, addition operation

[Root@krlcgcms01 mytest]# let a=34+3;

[Root@krlcgcms01 mytest]# Echo $a;

23,export//View all environment variables

24,echo $PATH//view a single variable

25,CMP file1 file2//file content comparison

26,clear//Clear screen

27,echo 23423 |awk--re-interval '/[0-9]{3,}/'//If not added Re-interval, not shown

28,cal//Get a neat calendar format

29,wc-l//Statistic line number, wc-w statistic words

30,echo "AaDCbd23" |TR "[A-Z]" "[A-z]" uppercase to lowercase, echo "AaDCbdc23" |tr-c b-d = Replace strings other than b-d with =

31,echo "ADSF" | Iconv-f utf8-t GBK//convert character from UTF8 to gbk-f is from and shorthand,-t as if terminal

32,cat-n File//content will show line number before

33,chattr +i File//read-only, root user cannot modify it

34,lsattr File//View files Properties

35,CAT/ETC/PASSWD |awk-f: ' {print '} '//View all users on the system

36,cat/etc/group//View all groups in the system

37,groups//check before current user, all groups

38,USERMOD-G Group name user//This way is to cover the way, use the time to be careful if the user A is sex in MySQL usermod-g php mysql so only

Belongs to PHP,

39,USERMOD-G Group name User//This is the way to add, if User A is in MySQL usermod-g php mysql in this way, MySQL belongs to 2 groups

40,BC//into the mathematical calculation

41,umask 003 U permission is the 7,g permission is 7, the other user is 4, namely 774,777-003=774

42,MKFS-T VFAT/DEV/HDA6//format a partition in a removable hard drive into a VFAT format

43,mount/dev/cdrom/media/cdrom//Mount CDROM

44,getent Group 532//The group ID is used to find the information

45,last//Login Successful user record

46,LASTB//Login unsuccessful user record

47,dump-s/dev/sda2//Check the capacity you want to back up/dev/sda2

48,dump-0j-f/dev/hda2/sda2_bak.dump.bz2/dev/sda2//Backup and compress sda2

49,restore-t-f/dev/hda2/sda2_bak.dump//view backup information

50,restore-r-f/dev/hda2/sda2_bak.dump//restore Backup

51,fc-list//View the fonts installed in the system

52,find./-type f-exec grep-q "root" {}; -exec echo {}; Find the string contained in a file in the directory

53,vmstat 5//per 5 display of the system information, CPU,MEMORY,I/O, etc.

54,top the sort display of the process after the SHIFT + P occupies

Sort display of memory after 55,top in Shift + M

56,IPTRAF-G//View the flow of each interface

57,ostat-d-x/dev/sda2 2////Iostat View disk I/O for disks/dev/sda2, refresh once every two seconds

Paste-sd ' | | | n ' Test//file is converted to 1 lines per 4 lines and separated by |

59,lsof-i: 22//Know what program the 22 port is running now

60,LSOF-C ABC//show the files that the ABC process now opens

61,lsof-p 12//See which files are open for process number 12

63,route//View routing information

64,IFUP//Open Network card

65,ifdown//Turn off the NIC

66,route del-net 172.168.0.0 netmask 255.255.0.0 dev eth0//delete 172.168 this network segment

67,route add-net 172.168.10.0 netmask 255.255.255.0 dev eth0//Add a route

68,NETSTAT-TUNL//List of listening Network service ports

69,netstat-tun//List of connected Network service ports

70,NMAP-SP 172.30.4.0/24//How many users in this network segment operate on my host, a good security check tool

71,vgdisplay//View free space in the system

72,lvextend-l+20g/dev/tank/part1//Add 20G of space to part1 this partition

73,lvresize-l-10g/dev/tank/part2//Part2 This partition to reduce 10G of space

74,pvdisplay//View disk information

75,mplayer-loop 10/mnt/song/music/flowers opened. mp3//Loop play 10 times

76,pacman-s firefox-nd//nd Remove Dependency

77,wget-c//Breakpoint Download

78,chroot/mnt/ubuntu//Change root directory to/mnt/ubuntu

79,ctrl+a//Command line, cursor call to start

80,ctrl+e//Command line, cursor move end

81,cut-d:-F 1-4 Test//use: Split file, take 1-4 columns after split

82,file/home/zhangy/test.php//To view some basic information about a file

83,touch test.txt//Create an empty file Text.txt

84,htpasswd-cbd/usr/local/nginx/conf/authfile//Create access control files

85,DF//view disk space, and current number of disks

86,fdisk-l//View all disk count

87,alsamixer//Enter, the M key can be mute

88,killall httpd//Kill all httpd processes

89,killall-9 Mysqld_safe//Some process superuser will not stop,-9 is forced to delete

90,mirror/mysql//Download MySQL directory

91,mirror-r/mysql//upload MySQL directory

92,rmmod PCSPKR//Turn off tab beep

93,modprobe PCSPKR//Turn on tab beep

94,gpasswd-a zhangy Wheel//Add zhangy This user to wheel this group

95,dd If=/dev/zero of=/virtual/ubuntu.virt.img bs=1m count=4096//Create a 4G img image

96,lspic//Display PCI devices

97,LSUSB//Display USB device

98,history | Less//less root more a bit like, feel less use more comfortable point

99,ln-s//If forgot-s becomes a hard link

100,tar zxvf test.tar.gz-c/home/zhangy//extract content to specified directory

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.