Linux basic use

Source: Internet
Author: User
Tags gz file uncompress

1. Switch from xterm to term (PTS-> TTY)

CTR + ALT + F1 ~ F6 can be switched to 6 consoles

CTR + ALT + F7 ~ F12 can be switched back to six X terminals

Note: during kernel programming or driver module development, the message is printed to the TTY terminal, which is invisible under xterm and can only be viewed. Therefore, we recommend that you go to the terminal for development when developing the driver, and use Vim very well.

2. Basic use of VIM

Two modes: Command mode and insert mode)

The command mode is as follows:

I enter the insert mode

: Q: Exit vim.

: W save

: WQ save and exit

: Set SYN = C set C-style syntax highlighting

Configure the vim configuration file: ~> Sudo Vim/etc/Vim/vimrc

Syntax on "enable syntax highlighting

Set tabstop = 4
Set softtabstop = 4
Set shiftwidth = 4 "indent width
Set autoindent "auto indent

Set cindent "C style indent

Set nu "display row number

 

Set VB t_vb = "Close the bell" to close the vim bell

3. Basic makefile writing

4. driver development

Uname-R: print the current kernel version

Uname-a print system name, kernel version, date ....

Dmesg prints kernel messages

 

Download Linux KernelSource codeThe Ubuntu source code header file is incomplete.

 

5. Basic decompression command

1. Files with. A extension:
# Tar XV file.
2. files with the. Z extension:
# Uncompress file. Z
3.files with the extension of .gz:
# Gunzip file.gz
4.files with the extension of .bz2:
# Bunzip2 file.bz2
5.files with the extension of .tar. Z:
# Tar xvzf file.tar. Z
Or # compress-DC file.tar. z | tar xvf
6.files with the extension .tar.gz/. tgz:
# Tar xvzf file.tar.gz
Or gzip-DC file.tar.gz | tar xvf-
7.files with the extension of .tar.bz2:
# Tar xvjf file.tar.bz2
Or Bzip2-DC file.tar.bz2 | xvf-
8.files with the extension .cpio.gz/. cgz:
# Gzip-DC file. cgz | cpio-Div
9. files with the. cpio/cpio extension:
# Cpio-Div file. cpio
Or cpio-divc file. cpio
10. Install files with the. RPM extension:
# Rpm-I file. rpm
11. decompress the file with the. RPM extension:
# Rpm2cpio file. RPM | cpio-Div

Network Management Forum bbs_bitscn_com

12. Install files with the. Deb extension:
# Dpkg-I file. Deb
13. decompress the file with the. Deb extension:
# Dpkg-Deb -- fsys-tarfile file. Deb | tar xvf-ar P
File. Deb data.tar.gz | tar xvzf-
14.files with the extension of .zip:
# Unzip file.zip
Decompress WinZip files in Linux
If JDK is installed, you can use the jar command and the unzip command.
Directly decompress the .tar.gz File
The xxxx.tar.gz file uses tar with the zxvf parameter and can be decompressed once. XXXX is the file name. For example:
$ Tar zxvf xxxx.tar.gz decompress various compressed files (Installation Method)

Decompress the file extension (Installation Method)

. A Ar XV file.
. Z uncompress file. Z
. GZ gunzip file.gz
. Bz2 bunzip2 file.bz2
. Tar. Z tar xvzf file.tar. Z
Compress-DC file.tar. z | tar xvf-
.Tar.gz/. tgz tar xvzf file.tar.gz
Gzip-DC file.tar.gz | tar xvf-
.Tar.bz2 tar xvjf file.tar.bz2
Bzip2-DC file.tar.bz2 | xvf-
.Cpio.gz/. cgz gzip-DC file. cgz | cpio-Div
. Cpio/cpio-Div file. cpio Network Management Forum bbs_bitscn_com
Cpio-divc file. cpio
. RPM/install rpm-I file. rpm
. RPM/extract rpm2cpio file. RPM | cpio-Div
. Deb/install dpkg-I file. Deb
. Deb/exrtact dpkg-Deb -- fsys-tarfile file. Deb | tar xvf-
Ar P file. Deb data.tar.gz | tar xvzf-
. Zip unzip file.zip

Bzip2-D myfile.tar.bz2 | tar xvf

Tar xvfz myfile.tar.bz2

X is decompression
V is a complex output.
F is the specified file
Z gz format

Gzip
Gzip [Option] file name to be compressed (or decompressed)
-C writes the output to the standard output and keeps the original file.
-D: compress the compressed file.
-L the following fields are displayed for each compressed file: size of the compressed file, size of the uncompressed file, compression ratio, and name of the uncompressed file.
-R recursively searches for the specified directory and compresses or compresses all the files in it.
-T to test whether the compressed file is complete.
-V shows the file name and compression ratio of each compressed and decompressed file.
-Num-adjust the compression speed with the specified number.
Example:
Create a full file named usr.tar in the full directory of the/usrdirectory.
Tar CVF usr.tar/home

Create and compress all the directories in the/usr directory. The file name is usr.tar.gz.

 

Tar czvf usr.tar.gz/usr
A group of files with the suffix tar.gz
# Tar CVF back.tar/back/
# Gzip-Q back.tar
Or
# Tar cvfz back.tar.gz/back/
Release a file suffixed with tar.gz.
# Tar zxvf back.tar.gz
# Gzip back.tar.gz
# Tar xvf back.tar

 

 

 

 

 

 

 

 

 

 

 

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.