Linux tips (1)

Source: Internet
Author: User
Linux tips (1)-Linux general technology-Linux technology and application information. For more information, see the following. It may be inconvenient to use Linux at first, but it will become more and more convenient after some skills are mastered for a while. the following are some of my experiences and skills that have been accumulated since I used Linux. I believe this will help beginners.

1. Use the virtual console

After logging on to the system, press Alt + F2. Then you can see the "login:" prompt, which is the second virtual console. Generally, the newly installed Linux has four virtual consoles. You can use Alt + F1 ~ Alt + F4 to access the virtual console. The most useful time is that when a program fails to lock the input, you can switch to another virtual console to log in and kill the wrong process.

2. copy and paste

Character interface: whether Slackware or RedHat is installed, a program named gpm is automatically run every time it is started. After the program runs, you can copy and paste it with the mouse. the specific method is to hold the left mouse button and drag it to make the place to be copied reversed. At this time, the area to be reversed has been copied, right-click the copied content and paste it at the cursor position.

X-Window: The copy operation is the same as that on the Character interface. If the three-Key mouse is used, press and paste the key, press the left and right keys at the same time (select Emulate 3 Button in the mouse settings when XF86 is configured ).

3. quick access to some Directories

Type cd ~ You can access the user's home directory.

Type cd-to enter the previous directory.

4. Use of the soft drive

For Linux ext2 file system, run the following command:

# Mount-t ext2/dev/fd0/mnt

For a floppy disk in dos format, run the following command:

# Mount-t msdos/dev/fd0/mnt

Then you can access the content of the floppy disk in/mnt. Note that you need to unmount the file system on the floppy disk before removing the floppy disk,

# Umount/mnt

Otherwise, information will be lost.

To create a file system on a floppy disk, run the following command:

# Mke2fs/dev/fd0 1440

5. display the color directory list under RedHat

Open/etc/bashrc and add the following line:

Alias ls = "ls -- color"

The color directory list will be displayed as shown in Slackware when bash is started next time. The color meanings are as follows:

Blue --> directory

Green --> Executable File

Red --> compressed file

Light blue --> link file

Gray --> other files

6. display file type

You can use the command file to know whether a file is an executable file in ELF format, a shell script file, or other formats. For example:

# File startx

7. command file path

When you type some commands such as find, shutdown, mount, and startx, do you want to know which directory these files are stored in? Use commands

Whereis can be implemented.

# Whereis startx

8. Search for files

The find command must add some parameters to check the file, for example:

# Find/usr-name XF86Setup-print

Find the file XF86Setup in/usr.

9. Delete useless core files

Sometimes a file named core is generated after the program runs. This file is usually large and useless. You can delete it to release space.

10. Unzip the .tar.gz File

To decompress the .tar.gz file, you must first decompress it with gunzip and then decompress it with tar. This can be done once in Linux, for example:

# Tar zxpvf sample.tar.gz

11. display the long file name in the win95 Partition

If you find that the long file life In the win95 partition cannot be displayed, you can mount it in vfat mode again. you can modify the/etc/fstab file for the mount partition at startup and change the msdos text to vfat. if you cannot use vfat mount, recompile the core and add support for vfat.

12. Norton Commander in Linux

After you type the command mc at the prompt, you will see a very similar interface with Norton Commander. In fact, the functions are very similar or even more powerful, for example, you can directly operate the files in the .tar.gz package (a bit like ZipMagic ).

13. directly go to X after startup

Edit the/etc/inittab file and change id: 3: initdefautl to id: 4: initdefautl. however, there may be some problems with the search path. When you shut down, you must directly go to/sbin to execute shutdown.

14. Run the X program in the background

When you run an X program, do not forget to add an & sign next to it, such as # netscape & otherwise, you will not be able to enter the command in that terminal window before launching the program to be executed.

15. Force exit X

Sometimes in X, the mouse and keyboard do not work due to program errors. In this case, don't worry, because in Linux, there is almost no vicious crash like IN Win95, you only need to press Ctrl + Alt + BackSpace to return to the character interface.
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.