Solve common Ubuntu commands and terminal Chinese garbled characters

Source: Internet
Author: User

I. Ubuntu common command ZZ: http://apps.hi.baidu.com/share/detail/9306265

Shortcut Key:
* Open the main menu = Alt + F1
• Run = Alt + F2
• Ctrl + H show all hidden files in the window
* Display desktop = CTRL + ALT + d
* Minimize the current window = Alt + F9
* Maximize the current window = Alt + F10
* Close the current window = Alt + F4
* Capture full screen = Print Screen
* Truncate window = Alt + Print Screen
Default special shortcut key
* Show All window Programs = F10
* Display the top program of the current window = F11
* Show All Programs in the current window = F12
* Switching window = Alt + Tab
* Rotate the 3D desktop = CTRL + ALT + left/right arrow (you can also place the mouse in the title bar or switch using the scroll wheel on the desktop)
* Rotate the 3D desktop (the activity window follows) = Ctrl + Shift + ALT + left/right arrow
* Manually rotate the 3D desktop = CTRL + ALT + Left click and drag the blank area on the desktop
* Window Transparency/opacity = possible with the "transset" utility or Alt + scroll wheel
* Zoom in once = super key + right-click
* Manual zoom in = super key + scroll up
* Manually zoom out = super key + scroll down
* Move the window = Alt + left-click
* Place a border when moving the window = left click to start dragging and then CTRL + ALT
* Adjust the window size = Alt + medium click
* Bring up the window below the top window = Alt + middle-click
* Dynamic effect deceleration = Shift + F10
* Water print = press Ctrl + super key
* Rain = Shift-F9
* Expand desktop = CTRL + ALT + down arrow, then press CTRL + ALT and left/right arrow to select Desktop

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A system command is automatically run at startup.

* Sometimes it is useful to add a custom command to the startup process, so that your computer can execute it every time it starts.
O edit crontab with administrative permissions (see Section 1.3.3-root user and sudo command ):
+ Sudo crontab-e
O Insert the following content: @ reboot/home/user/command
+ Replace/home/user/command with the absolute path of your command.
O save the file and exit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Start the program with a shortcut key

Add a keyboard shortcut for the program you specified. You only need to press the corresponding shortcut key to start the program and so on. Just like we add a hotkey for the shortcut when using XP, gnome also has these features, setting is not difficult. First open the terminal and enter:

Gconf-Editor

Open "apps-> metacity-> keybinding commands" in sequence, and a total of 12 commands can be defined here, as shown in. I set command_1 to open rhythmbox player, and command_2 to open the swiftfox browser, command_3 open the terminal and you can add the commands you need.

After adding the key, go to "apps-> metacity-> global keybingdings" and add the shortcut key you want. For example, if I have filled in a total of three commands, including command_1, command_2, and command_3, then I want to fill in a shortcut key combination on run_command_1, run_command_2, and run_command_3, the shortcut key can be, F1 to F12, and a combination of letters. F1 indicates pressing CTRL + ALT + F1 at the same time, and so on.

Now you only need to press the shortcut key you just set to run the command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
No classification PS1 command name usage and Parameter Function Annotation
1. File Management # ls-A lists all files in the current directory, including hidden files with A. header.
File Management # ls-l or ll lists the details of files in the current directory
File Management # PWD view the absolute path of the current directory
File Management # CD .. back to the upper-level directory of the current directory
File Management # cd-back to the last directory
File Management # Cd ~ Or CD back to the current user's home directory
File Management # Cd ~ The user name is returned to the specified user's home directory.
2. File Management # create a directory with the mkdir directory name
File Management # mkdir-P recursively create some nested Directories
File Management # rmdir empty directory name to delete an empty directory
3. File Management # delete one or more files by RM file name
File Management # rm Rm-RF non-empty directory name recursively deletes everything in a non-empty directory, without the mention of-F
4. File Management # view the file content on a single screen with Cat file names
5. File Management # View File Content by page for more file names
6. File Management # The file content can be viewed on Controllable pages with less-than file names
7 file management # grep character file names view part of the file content based on character matching
8. File Management # Move the files under the music/video path/file path to the absolute path
File Management # change the name of the MV file in the current directory
9 file management # cp CP/path/file./move files under absolute path to the current directory
10 file management # Find find path-name "string" to find the files and directories that match the string in the path
11 file management # ln Source File Link name creates a hard link to the source file of the current directory
Ln/home/test/usr/test1 create a hard link for/home/test under/usr
12 file management # ln-s a B create the symbolic link B of A in the current directory
13 file management # Touch touch file1 file2 create two empty files
14 disk management # DF is used to report the total capacity, usage, and remaining capacity of the file system.
15 disk management # Du-B/home view the current/home directory capacity (K) and sub-directory capacity (k ).
16 disk management # fdisk-l view system partition information
17 disk management # fdisk/dev/SDB is used to partition a new SCSI hard disk.
18 disk management # mkfs. ext3 mkfs. ext3/dev/sdb1
Format the first primary partition of the first SCSI hard disk
Ext3 File System
Mkfs. ext2 mkfs. ext2/dev/sdb2 format to ext2 File System
19 disk management # mount Mount-T file system type device access path
Disk management # file system type
Iso9660 optical drive File System
Vfat FAT file system (Windows)
Mount the optical drive # Mount-T iso9660/dev/CDROM/mnt/CDROM
Mount fat # Mount-T vfat/dev/hda5/mnt/CDROM to mount the fifth logical partition of the first ide
17 disk management # umount/mnt/CDROM unmount/mnt/CDROM is empty
18 file permissions # chmod U + s file adds special permissions to the file owner
Chmod g + R file: Add read permission to the file group
Chmod o + W file adds write permission to other users of File
Chmod A-X file: all users of the file minus the execution permission.
Chmod 765 The owner of file is set to full permission, and the owner group is set to read/write permission. Other users have read and execute permissions.
19 File Permission # chown root/home change/home owner to root user
20 file permissions # change the/home group to the root group for chgrp root/home
21 print management # RedHat-config-printer-tui enter the printer installation Interface
22 print management # LP Lp-D hptr file print file to the hptr printer
23 print management # lpq-P printer name view printer status
24 print management # lprm-P printer name a delete print jobs in the printer
25 print management # disable-R "Changing paper" hptr disables the printer and prompts the cause
26 print management # enable hptr re-enable disabled
27 user management # useradd create a new user
28 user management # groupadd group name to create a new group
29 user management # passwd user name creates a password for the user
30 user management # passwd-D passwd-d the user name can also be logged in if you delete the User Password
31 user management # passwd-l user name locking account and password
32 user management # passwd-u user name unlock account password
33 user management # passwd-s user name query account and password
34. User Management # usermod-l new username old username changed to user name
35 user management # usermod-l usermod-L to lock the user name to lock the User Login
36 user management # usermod-u unlock user name unlock User Login
37 user management # usermod-u 501 Change User uid
38 user management # userdel-r user name delete all user information
39 user management # groupmod-N new username old username rename Group
40 user management # groupmod-G 501 Group Name Change Group GID
41 user management # groupdel the group name should first delete its users to delete the group
42 user management # gpasswd-A gpasswd-a username group name is added to the group
43 user management # ID user name query user information
44 software management # rpm-Qa | less query installed RPM
45 software management # rpm-Qa | grep FTP query specified rpm
46 software management # Check whether the RPM package has been installed by rpm-Q
47 software management # rpm-Q telnet-Server View telnet server package
48 software management # rpm-Qi software package name View Software Description
49 software management # query the file list of a software package by rpm-QL package name
50 software management # rpm-QF package name query the package to which a file belongs
51 software management # Full name of rpm-QP Software Package Query Information of uninstalled software packages
52 software management # delete a specific software package by rpm-e rpm-E Software Package name
53 software management # Full name upgrade of rpm-u rpm-uvh software package and display the process
54 software management # Full name of rpm-IVH software package installation package and display process
55 software management # rpm-V software package name verification package size and type
56 software management # tar-C create package-x release package-V display command process-Z represents the compressed package
57 software management # tar-CF tar-CVF benet.tar/home/Benet package the/home/Benet directory
58 software management # tar-CZF tar-zcvf benet.tar.gz/mnt package and compress the Directory
59 software management # tar-TF benet.tar: List of non-compressed files
60 software management # tar-tzf tar-TF benet.tar.gz view the file list of the compressed package
61 software management # tar-XF benet.tar non-compressed package file recovery
62 software management # extract and restore the files in the tar-zxvf benet.tar.gz compressed package
63 software management # tar-jxvf benet.tar.bz2
64 software management # diff file1 file2> patch name. Patch generates patch files for new and old files
65 software management # diff file1 file2 compares the differences between the two files
66 software management # patch file patch name. Patch patch
67 software management #./configure -- prefix =/usr/local/pre-compilation Configuration
68 software management # Make Compilation
69 software management # make install the compiled source code package
70 boot management # reboot init 6 restart Linux
71 start management # halt init 0 shutdown-H now disable Linux
72 start management # runlevel display system running level
73 startup management # init [0123456] changes the system running level, 7 types
74 start management # chkconfig -- list [service name] to view the service status
75 startup management # chkconfig -- level <running level> <service name> On | off | set sets the startup status of the service.
76 startup management # chkconfig <service name> On | off | set the startup status of a non-independent service
77 Process Management # top dynamic PS-Aux static process tree pstree view system processes
78 Process Management # program name & background running program
79 Process Management # FG transfers the processes running in the background back to the foreground
80 Process Management # BG transfers the processes running on the foreground to the background
81 Process Management # renice + 1 180 Add the priority of process No. 180 to 1
82 Process Management # Kill kill PID to terminate a PID Process
83 Process Management # at 5 + 3 days
/Bin/ls specify to execute/bin/ls at PM three days later
84 Process Management # crontab-e uses VI to edit Automatic periodic tasks
85 Process Management # crontab-l view Automatic periodic tasks
86 Process Management # crontab-r Delete Automatic periodic tasks
87 Process Management # crond service crond <START | stop | restart | status>
Enable Automatic periodic service crond immediately <START | stop | restart | status>

Implement Disk Quota (Note: Create/home partition when installing Linux)
Objective: To implement a disk quota of 5 kb for soft limit and 10 kb for Zhao in the/home directory.
Steps:
1. Modify the line containing/home, # vi/etc/fstab, and change it to defaults and usrquota. That is, the usrquota item is added. Save and exit.
2. Uninstall the/home directory # umount/home
3. Mount/home directory # Mount/home
4. Add User Zhao # useradd Zhao
5. Change the password # passwd Zhao
6. Generate quota information about the/home directory # quotacheck-cmug/home
# Quotacheck-vu/home
7. View information of all users # repquota-Au
8. Set the quota # edquota-u Zhao
Change soft and hard to 5 and 10 respectively.
9. Save and exit # WQ!
10. modification time # edquota-T
11. # WQ!
12. Enable the disk quota function on/home # quotaon/home
13. query the quota # quota-u Zhao
14. Verify the quota # Su-zhao II, UBUNTU terminal garbled solution ZZ: http://apps.hi.baidu.com/share/detail/21568014 Alt + Ctrl + F1 into the first terminal, found Chinese garbled.
2. Install zhcon. Sudo apt-Get install zhcon
3. Enter the following command to start zhcon. The Chinese characters are displayed normally. Zhcon -- utf8 -- DRV = the VGA method does not work !! Later, I finally solved the problem according to the following method. Although it was not my own method, I was still very happy to copy it and share it with you. At the same time, record the problems you encounter when learning Ubuntu for your reference in the future! //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// /Solution: i. ubuntu default Chinese character encoding is zh_CN.UTF-8, which can be seen in/etc/environment:
Sudo gedit/etc/environment
You can see the following content:
Path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/Games"
Lang = "zh_CN.UTF-8"
Language = "zh_cn: Zh: en_us: en"
The second line is the default Chinese character encoding. Note: you can modify the default Chinese character encoding here, for example, zh_cn.gbk. 2. How to add Chinese character encoding
1. Use locale-gen directly
Enter the following command on the terminal:
Sudo locale-gen zh_cn.gb18030
The Chinese character set can be added. After that, go to/usr/lib/locale/. There is a folder named zh_cn.gb18030, and enter the command gedit/var/lib/locales/supported on the Super Terminal. d/local. You can find another row in the file: zh_cn.gb18030 gb18030. It indicates that the application is successfully added. 2. Modify the/var/lib/locales/supported. d/local file
Enter the command line in the terminal
Sudo gedit/var/lib/locales/supported. d/local
You can see the following content:
Zh_CN.UTF-8 UTF-8
The en_US.UTF-8 UTF-8 adds the Chinese Character Set zh_cn.gbk GBK at the end of the file and then exits. Enter the command on the terminal: sudo dpkg-reconfigure localesgenerating locales...
En_AU.UTF-8... Done
En_BW.UTF-8... Done
En_CA.UTF-8... Done
En_DK.UTF-8... Done
En_GB.UTF-8... Done
En_HK.UTF-8... Done
En_IE.UTF-8... Done
En_IN.UTF-8... Done
En_NZ.UTF-8... Done
En_PH.UTF-8... Done
En_SG.UTF-8... Done
En_US.UTF-8... Done
En_ZA.UTF-8... Done
En_ZW.UTF-8... Done
Zh_cn.gbk... Done
Zh_CN.UTF-8... up-to-date
Zh_HK.UTF-8... Done
Zh_SG.UTF-8... Done
Zh_TW.UTF-8... Done
Generation complete. You can generate the corresponding file:/usr/lib/locale/zh_cn.gbk/And then restart ubuntu.

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.