Notes for Linux

Source: Internet
Author: User

1.View the file and folder size in LinuxDF, Du, and LS-lH commands;

View the disk partition table tool fdisk-L;


2. Clean up system garbage in Linux

Error

Rm-F logfile

Cause

If the application has opened the file handle and directly deletes it, the following error occurs:

1. The application cannot correctly release log files and write logs.

2. the disk space is not released.

Correct

CAT/dev/null> logfile


3.View the Linux release version (used in Ubuntu 12.04.2 LTs)

Simon @ Simon-presario :~ $ Sudo lsb_release-


4. vimfaq:

Http://wiki.ubuntu.org.cn/index.php? Title = vimfaq & variant = ZH-CN


5. Template File

/****************************************Copyright (c)****************************************************                                 Hubei electronics Co.,LTD.                                    ****--------------File Info-------------------------------------------------------------------------------** File Name: example.c** Last modified Date: 2012-01-01 ** Last Version: v1.0** Description: Template file****------------------------------------------------------------------------------------------------------** Created By: He Pusheng** Created date: 2012-01-01 ** Version: v1.0** Descriptions:**********************************************************************************************************/

6./etc/fstab & etc/mtab file Introduction

File/etc/fstab stores the file system information in the system, and/etc/fstab is prepared for loading by the system.

The/etc/mtab file records the file systems that have been mounted by the system, including virtual files created by the operating system.


7. dd command usage

Dd is a powerful Io input/output targeting tool. If it is improperly used, it is highly destructive, not only the current partition, but also the current system and sometimes the entire hard disk. Sudo dd If =/dev/Zero of =/dev/SDA // clear all hard disks.
8. $ shlvl in Shell

Purpose of the variable: record the nested hierarchy of the Current Shell, initially 1

For example, in the following example: the current layer is 3rd. After the bash command is executed, the $ shlvl variable is changed to 4.

[lds@lds ~]$echo $SHLVL3[lds@lds ~]$bash[lds@lds ~]$echo $SHLVL4

9. Delete the old Kernel File

Due to the automatic upgrade of ubuntu, many old kernel files are generated. You can delete the old kernel files using the following method.
1. Simon @ Simon-presario :~ $ Dpkg -- Get-selections | grep Linux # This command prints the installed and uninstalled kernel files. The imgfile is the kernel file to be detached.
2. Simon @ Simon-presario :~ $ Sudo apt-Get autoremove linux-image-3.5.0-23-generic



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.