Some useful tips for Linux

Source: Internet
Author: User
Tags dmesg linux mint

1. Automatic completion

2, wildcard

3. MPS queue Filtering

4. Redirection

5. Modify Environment Variables

6. View startup items and restart services

7. System and device management. View serial ports, PCI, and USB devices.

8. Execute the latest command.

9. Help

10. Common shortcut keys

11. Use the root user

12. Restart x

You can refer to these two articles to configure Ubuntu:


Ubuntu Configuration Guide

Http://blog.csdn.net/liang890319/article/details/8262389

Make your Ubuntu shine better

Http://blog.csdn.net/liang890319/article/details/8262398


1. Automatic completion

The use of the tab key command function file name variable auto-completion

2, wildcard

* Match any character or string to view the. c ended file ls *. c

? Match any character to view the. c file that starts with 0 plus one character ls 0 ?. C

【....] Match a single character in any bracket to view the LS [ADF]. c file containing a d F

3. MPS queue Filtering

The pipeline outputs an execution result to another program as its parameter.

For example, we need to check the USB Module in the device.

Lsmod | grep USB

View processes that contain Apache

PS-Ef | grep Apache

4. Redirection

Echo $ PATH> 1.txt write the execution result to the file 1.txt

Echo $ PATH> 1.txt: append the execution result to the end of file 1. txt.

5. Modify Environment Variables

View the environment variable Export

Modify the environment variable Vim/etc/profile

Add export a = xxx at the end

If you want to apply sudo sourceprofile or./profile immediately

6. View startup items and restart services

View startup Item dmesg

Service Restart service Samba restart

7. System and device management

It mainly refers to proc file system viewing and module management.

Common commands

Init. D. Modify the startup information.

Dmesg display startup information

CAT/proc/modules view the current system module

Lsmod insmod rmmod depmod view load Delete View module dependency

Lsusb lspci view USB device PCI device

View system status information using procinfo

View serial port

Check whether the serial port is available. You can send data to the serial port, for example, to the COM1 port, echo lyjie126>/dev/ttys0 check the serial port name. Use LS-L/dev/TTYs *. Generally, the serial port names are all under Dev or lsmod, for USB to serial port lsusb, the name is ttyusb *
If you do not have an plug-in serial port card, the default value is TTYs * under Dev. Generally, ttys0 corresponds to COM1 and ttys1 corresponds to com2, which is not necessarily inevitable. view the serial port driver: CAT/proc/tty/Drivers/SERIAL: dmesg | grep TTYs *

8. Execute the latest command.

History View recently used commands

!! Executing the previous command is equivalent to R.

! + A number execution history record

Press the tab twice to view all

9. Help

Man

Infor

Help

Whereis

Whatis

Which

10 common shortcut keys

CTRL + win + D Display Desktop

Win + W tiled all windows

Windows extended by win + S

CTRL + ALT + t open the terminal

CTRL + Shift + N create a terminal

CTRL + Shift + T new tag

CTRL + ALT + FN switch to command mode F7 back to the x Interface

11. Use root permission

Sudo passwd Root

Enter the password.

12 restart X (use OK in Linux mint)

Method: 1 CTRL + ALT + backspace restart X-Window

Method: 2. First, CTR + ALT + F1 enters the Linux terminal. Of course, when your Linux interface crashes, it automatically enters the command line terminal. 2. Enter the following command: sudo Service Running-Agent restart. If not, try: sudo/etc/init. d/running-agent

If the shortcut key cannot be used, see method 3.

Method: 3

From Ubuntu 9.10, uubntu disables the combination key Ctrl-alt-backspace to restart X server. Now let's talk about how to start Ctrl-alt-backspace in Ubuntu 11.04 to restart X server.

#1. Press ctrl-alt-backspace in Ubuntu 11.04 to restart X server.

#1. Click unity launcher and enter keyboard to start the program, or press Alt + F2 and enter keyboard to start the program.

#2. Switch to the (layouts) "layout" option, click the options ("options") button below, and select "Key sequence to kill the X server (Control + ALT + backspace). As shown in,


#2. Press ctrl-alt-backspace in ora 14 to restart X server.

#1. In The GNOME environment:

"System-preferences-keyboard-layout", click "layout options", and select "Key sequence to kill the X server (Control + ALT + backspace. #2. In the KDE environment:

"System settings"-"Regional & Language"-"keyboard layout"-"advanced, select "Key sequence to kill the X server (Control + ALT + backspace.

Original article: http://www.bentutu.com/2011/05/enable-restart-x-server-ctrl-alt-backspace-in-ubuntu-11-04-natty-narwhal-and-fedora-14-laughlin/

    Quick Start with 19 tips for installing medibuntu on 10 indicator Ubuntu 11.04 apps in Ubuntu 11.04

[Responsible editor: Li Jing Tel :( 010) 68476606]

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.