Linux Command sorting

Source: Internet
Author: User

Organize some Linux commands

I. File directory commands

1. Create a directory: mkdir directory name

2. Delete the empty directory: rmdir directory name

3. Delete the subdirectory unconditionally: rm-rf directory name

4. Change the current directory: cd directory name (go to the user's home directory: cd ~; Go to the upper-level Directory: cd -)

5. view your own directory: pwd

6. view the current directory size: du

7. display the directory file list: ls-l (-a: add an implicit directory)

Blue: Directory; Green: executable file; Red: compressed file; light blue: linked file; Gray: other files; Red: Wrong link file

8. Browse File: more file name. txt; less file name. txt

9. copy the file: the target file of the cp source file (-r: Contains directory)

10. find the file: (1) find (2) locate command name

11. Link: (1) create a hard link: ln to link the source file (-d: create a directory link); (2) create a symbolic link: ln-s to link the source file

 

Ii. Driver mounting command

1. Check hard disk usage: df-T-h

2. Check the disk partition: fdisk-l

3. mount the hardware and software areas: mount-t/dev/fdx | hdax/mnt/directory name

Among them: modos -- FAT16; vfat -- FAT32; ntfs -- NTFS; optical drive -- iso9660

Supported Chinese names: mount-o iocharset = x/dev/hdax/mnt/directory name (where: x = cp936 or

Mount the optical drive: mount-t auto/dev/cdrom/mnt/cdrom

Mount the ISO file: mount-t iso9660-o loop xxx. iso/path

4. unmount: umount/mnt/directory name

Unmount all: umount-

5. Create a file system: mkfs-t/dev/hdxx. Ftype: ext2, ext3, and swap

 

3. Program Installation commands

1. RPM package installation: (1) install rpm-ivh somesoft. rpm

(2) reverse install rpm-e somefost. rpm

(3) query rpm-q somefost or rpm-qpi somefost. rpm (where: p is not installed; Information contained in I)

(4) query the location after installation: rpm-ql somefost. rpm

(5) upgrade and install: rpm-Uvh somesoft. rpm

(6) force installation: rpm-ivh -- nodeps somesoft. rpm or rpm-ivh -- nodeps -- force somesoft. rpm

2. Install the source code package:

Read README

Basic usage (1) configuration: extract the directory./configure

(2) Compile: extract the make

(3) installation: make install in the decompressed directory

3. Install src. rpm

 

Iv. compression and decompression commands

1.tar.gz class: (1) extract: tar-xvzf file .tar.gz((2)tar.gz to tar: gzip-d file .tar.gz (2) compression: gzip file to be compressed

2.tar uncompressed class: (1) Unpack: tar-xvf file .tar; (2) package: tar-cvf file .tar file list

3.zip: (1) decompress: unzip file. zip-d dir; (2) Compressed: zip zipfile list of files to be compressed

4.bz2: (1) decompress: bunzip2 file. bz2 or bzip2-d file. bz2; (2) compress: bzip2 File to be compressed

5. z class: (1) decompress: uncompress file. z; (2) compress: compress File

Recommended reading:

Linux Command cd

Cat for Linux commands

Linux Command alias/unalias

Linux Command Parsing: su root and su-root

Interactive input of Linux commands read

  • 1
  • 2
  • Next Page

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.