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