Linux Novice Prerequisite 100 commands Linux common commands Daquan

Source: Internet
Author: User
Tags arithmetic

  Linux Common Command Encyclopedia 100:

1, echo "AA" "Test.txt and Echo" BB "" test.txt//"empty the original file, and the content written to the file," "Put the content to 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//List of archived content

4, Du-ah//view file list size

5, Du-sh//View the total size of all files

6, Echo ' 1+2 ' |bc-l//mathematical operation

7, uname-a//View some information of Linux kernel, etc.

8, Badblocks-s/DEV/SDA//Bad track scan show progress

9. Time command//view the runtime of the commands

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

11, rsync-p//sync Display progress

12. History-c//Clear History command

13, CD-//back to last Catalog

14, Tree//Display directory Trees

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 for the unit display memory

21,uptime//shows how long the system has been running, in turn, it displays the following information: 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//clean screen

27, Echo 23423 |awk--re-interval '/[0-9]{3,}/'//If not re-interval, do not show

28. Cal//Get a neat calendar format

29, Wc-l//Statistics line number, wc-w statistics words

30, echo "AaDCbd23" |TR "[A-Z]" "[A-z]" uppercase to lowercase, echo "AaDCbdc23" |tr-c b-d = Replace the b-d string into =

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 of the front will show line number

33, Chattr +i File//read-only, root users can not 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 the groups in the system

37, Groups//check before the 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 sex in MySQL usermod-g phpmysql such words only belong to PHP

39, USERMOD-G Group name user//This way is to increase the way, if the user a sex in MySQL usermod-g phpmysql so, MySQL belongs to 2 groups

40, BC/Enter the mathematical calculation to

41, Umask 003 u permission is 7,g permission is 7, other user is 4, namely 774,777-003=774

42, Mkfs-t Vfat/dev/hda6///move a partition in the hard drive into VFAT format

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

44, Getent Group 532//through the group ID, to find the group information

45, last//login successful user record

46, LASTB//login unsuccessful user record

47, Dump-s/dev/sda2//Check the capacity of the/dev/sda2 to be backed up

48, Dump-0j-f/DEV/HDA2/SDA2_BAK.DUMP.BZ2/DEV/SDA2//sda2 Backup and compression

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 the file under the directory

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

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

55, the top after the SHIFT + M occupied by the sort display of memory

56, Iptraf-g//view the flow of each interface

57, Ostat-d-x/dev/sda2 2///Iostat View disk/dev/sda2 disk I/O situation, refresh every two seconds

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

59, Lsof-i: 22//Know 22 port now run what program

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

61, Lsof-p 12//See which files were opened by process number 12

63. Route//View routing information

64, IFUP//Open 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 Listening Network service port

69, Netstat-tun//list of connected Network service ports

70, NMAP-SP 172.30.4.0/24//In this network segment how many users in my host operation, a good security check tool

71, Vgdisplay//view the free space in the system

72, Lvextend-l+20g/dev/tank/part1//to part1 this partition to increase the space of 20G

73, Lvresize-l-10g/dev/tank/part2//To 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 dependence

77, WGET-C//Breakpoint Download

78. Chroot/mnt/ubuntu//change root directory to/mnt/ubuntu

79, CTRL + A//command line, the cursor is said to start

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

81, Cut-d:-F 1-4 Test//use: Split file, take the divided 1-4 columns

82, file/home/zhangy/test.php//To view some basic information of the 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 numbers

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

88. Killall httpd//Kill all httpd processes

89, Killall-9 Mysqld_safe//Some process Super user also can 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//Open 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 devices

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

99, Ln-s//If forget the-s will become a hard link

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

Related Article

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.