My Linux Study Notes

Source: Internet
Author: User
My Linux Study Notes-general Linux technology-Linux technology and application information. For more information, see the following. Author: fgwzhl
1 top view of the currently running process

Kill-9 pid terminate a process (tree)

Cd returns the root directory

Pwd displays the current directory

3 less more view text file command in less press the v key will start vi to edit the current file

4. Command for mkdir and rm mv to change the file name and directory name

Cp copy file and directory commands

Man command usage reference tool, very useful

Nano is a compact, free, and friendly editor.

There are two modes for 5vi: Command mode and edit mode. After entering vi, it is in command mode by default.

Run vi LoveLetter. After entering, you can press the Insert function key or I key on the keyboard to enter the editing status. You can Insert characters and press Insert to change to the overwriting mode. The differences between the two modes are easily reflected, you can try it. Up, down, left, and right direction keys can move the cursor. There is no difference between basic editing commands and Windows. Is it easy? After you input the required content, we need to save it. Press ESC to return to the command mode from edit mode. First, enter a colon ":", that is, press the SHIFT key and then press the Semicolon ";" to enter a ":" first. Then, enter w and press enter to save the edited content to the LoveLetter file. Now we can click Insert to continue editing. Press ESC, enter ":", and then press w to save. But now we don't need to save it. If we want to quit without saving it, what should we do? When we enter w, it means write and save. Then we input q to exit quit. OK. Enter q and press Enter. vi prompts that the modification we just made has not been saved. So remember! Once we need to discard our changes, we cannot directly exit with the q command, but we need to use "q !" Command. Enter q !, Okay. Quit.

We want to see if the LoveLetter we just edited is actually saved. Then we can see vi LoveLetter and OK? Now, if you want to exit directly, you can simply enter ": q" without entering that "!". Because we have not modified the file content. If we modify this article, we can enter "ESC: wq" when exiting. You do not need to divide w and q into two inputs.

6 in linux, you can run the amount command to mount the iso file to the directory mount-t iso9660-o loop/home/kris/somewhat. iso/mnt/cdrom.

7. file Check file type

8 wall write mesg

9 reset the reset terminal. This method is used when a screen problem occurs.

10 env display environment variables

11. Change the system language by running export LC_ALL = "en_US" LANG = en_US. To keep outputting E files, you can modify LANG = "en_US. Utf-8" in/etc/sysconfig/i18n"

12 view the local ip Address: ifconfig-

13 mount the disc: mount/dev/cdrom/mnt/cdrom. Then, you can view the content of the disc in/mnt/cdrom. You can use umount, mnt, or cdromo to detach a CD. The disc can be displayed only after it is detached.

14 when you enter a file name at a linux prompt, you can enter a part of the file name and press the Tab key to intelligently complete the file.

15 install the rpm package in redhat: rpm-I "package path". To upgrade the package, run the rpm-U packagename command. It is easier to delete packages. You can use: # rpm-e packagename to delete the packages you want to delete without knowing the version and path.

16. Run the vsftp method and ntsysv at startup. Select vsftpd from the list.

17 View File Content: cat file name

18 find/-name "* network *"-print: find all files containing the network in the root directory.

Find/-iname "* network *"-print: searches for all files containing the network in the root directory, regardless of Case sensitivity.

19 useradd user1 creates a user, but this user cannot use it before setting a password for the user. The command for setting the password is passwd user1.

If there is a "*" next to the file name at 20 ls, it indicates that it is an executable file. You only need to run "*/file name.

21 restart the network service network restart

On the 22-character interface, enter the graphic interface startx. On the graphic interface, return the character interface: log out.

23. Install VMWare and select NAT as the Virtual Machine network type to implement communication between the host and the virtual machine. to remotely log on to linux, you also need to install the telnet service. By default, root cannot Log On Through telnet.

24. Delete non-empty directory: rm-rf directory name

25. How to decompress cpio: cpio-idmv <***. cpio

26. Run the shell script edited in UE to unix with the prompt "h ^ M: is not an identifier". Solution: Convert dtox a.txt> B .txt to unix format, or use the "file", "convert", "DOS to Unix" function in UE. Second, more convenient

27 find/usr-name httpd

28 decompress some. tgz: First gunzip some.tgzto generate some.tar, and then tar-xvf some.tar to decompress

29 add gcc to the path:

PATH = $ PATH:/usr/gnu/bin/

Export PATH

30. There cannot be spaces on either side of the equal sign of the variable value in the sh script

31. There must be no blank lines between command lines in the sh script, and spaces before and after the if statement.

32 determine the current terminal type echo $ TERM

33 re-obtain the ip Address:/etc/init. d/network restart

34. How to enter the ESC Escape Character in Linux: press Ctrl + V, and then press ESC

After 35, a program is run, that is, script exit and shell exit will not cause the program to exit: Add "&" after the command

36. The self-starting login script is placed in the "/etc/profile" file. For example, to configure Java environment variables, you must add the following to this file:

Pathmunge/usr/java/j2re1.4.2 _ 14/bin/after

JAVA_HOME = "/usr/java/j2re1.4.2 _ 14 /"

Note that there cannot be spaces on both sides of the equal sign in JAVA_HOME; otherwise, JAVA_HOME will be treated as a command.

37. Modify the LANG environment variable with garbled characters. This problem has occurred in the batch system before.

39. The trace in windows corresponds to the "traceroute IP Address" in Linux"

40 use a usb flash drive in Linux, insert a usb flash drive, create a usb directory in mnt, and run "fdisk-l" to display all devices, because the general usb flash disks are in the Fat format, find the identifier of the hard disk in the FAT format, such as sdb1, and then run mount-t vfat/dev/sdb1/mnt/usb; in this way, the usb flash drive will be mounted to/mnt/usb; umount/mnt/usb

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.