Must learn 100 common Linux commands Daquan

Source: Internet
Author: User
Tags arithmetic clear screen php mysql

1,echo "AA" > Test.txt and Echo "BB" >> test.txt//> Empty the original file, and the content is written to the file,>> put the content to the end of the file

2,chmod go+w-r/home/zhangy//Add Write permission to group users and other users

3,TAR-TZVF test.tar.gz//List 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 the Linux kernel, etc.

8,badblocks-s/DEV/SDA//bad path scan shows progress

9,time command//View the run time of the commands

10,LS-LRT//In reverse order by time

11,rsync-p//Show progress while synchronizing

12.history-c//Clear History command

13,CD-//return to last directory

14,tree//Display directory tree

15,umount-n/mnt/hda2//forced unload

16,echo ~///Display the user's home directory

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

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

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

20,FREE-M//have MB display memory

21,uptime//Display system has been running for how long, it displays the following information in turn: The current time, how long the system has been running, the current number of users, the system in the past 1 minutes, 5 minutes and 15 minutes of the average load

22, addition operation

[[email protected] mytest]# let a=34+3;

[Email protected] 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, do not show

28,cal//Get a neat calendar format

29,wc-l//Count rows, wc-w statistical words

30,echo "Aadcbd23″|tr" [A-Z] "" [A-z] "uppercase to lowercase, echo" aadcbdc23″|tr-c b-d = Replace a string other than b-d =

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

32,cat-n File//content is displayed in front of the line number

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 in the system

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

37,groups//Pre-check the current user's location, all groups

38,USERMOD-G Group name user//This way is covered by the way, use caution if User A is in MySQL usermod-g php mysql such words only

It belongs to PHP,

39,USERMOD-G Group name user//This way is increased by the way that if user A is in MySQL usermod-g php mysql so, MySQL belongs to 2 groups

40,BC//Enter into the mathematical calculation

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

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

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

44,getent Group 532//through group ID, to find groups 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 the/dev/sda2

48,dump-0j-f/dev/hda2/sda2_bak.dump.bz2/dev/sda2//sda2 to be backed up and compressed

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//viewing fonts installed in the system

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

53,vmstat 5//5 display System Information, CPU,MEMORY,I/O, etc.

54,top after SHIFT + P in the order of the process display

55,top after SHIFT + M in memory-based sort display

56,IPTRAF-G//View traffic for each interface

57,ostat-d-x/dev/sda2 2//Use Iostat to see disk I/O for disk/dev/sda2, refreshed every two seconds

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

59,lsof-i: 22//Know what program is running on Port 22 now

60,LSOF-C ABC//SHOW ABC process now open file

61,lsof-p 12//See which files the process with process number 12 opens

63,route//View routing information

64,ifup//Turn on the network card

65,ifdown//Turn off the network card

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 the network service ports that are listening

69,netstat-tun//List Connected Network service ports

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

71,vgdisplay//viewing available space in the system

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

73,lvresize-l-10g/dev/tank/part2//To part2 this partition to reduce the space of 10G

74,pvdisplay//View disk information

75,mplayer-loop 10/mnt/song/music/flowers open. mp3//Cycle 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 is called to start

80,ctrl+e//command line, cursor movement end

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

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 an Access control file

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

86,fdisk-l//View all disks

87,alsamixer//After entering, the M key can be used for mute

88,killall httpd//Kill all httpd processes

89,killall-9 Mysqld_safe//Some process Superuser also can't 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 an IMG image of 4G

96,lspic//Display PCI device

97,LSUSB//Display USB device

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

99,ln-s//If you forget-s becomes a hard link

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

Must learn 100 common Linux commands Daquan

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.