Find software in a software library
Apt-cache Search Regular Expression
Or
Aptitude Search Package
Display statistics for system installation packages
Apt-cache Stats
Displays the name of all available packages for the system
Apt-cache Pkgnames
Display the package information
Apt-cache Show k3b
Find out which package the file belongs to
Apt-file Search filename
To see which packages have been installed
Dpkg-l
Query software xxx depends on which packages
Apt-cache depends xxx
Query software XXX is dependent on which packages
Apt-cache rdepends XXX
Add a CD source
sudo apt-cdrom add
System upgrades
sudo apt-get update (This step updates the package list)
sudo apt-get dist-upgrade (Install all available updates in this step)
Or
sudo apt-get upgrade (This step installs application updates, does not install new kernels, etc.)
Clear the remainder profile for all deleted packages
If you report the following error, it is not necessary to worry that there is no residual configuration file in your system.
Dpkg:--purge needs at least one package Name argument
Type dpkg--help for help about installing and deinstalling packages; Use the ' dselect ' or ' aptitude ' for user-friendly package management;
Type Dpkg-dhelp for a list of dpkg debug flag values;
Type dpkg--force-help for a list of forcing options;
Type dpkg-deb--help for help about manipulating *.deb files;
Type dpkg--license for copyright license and lack of warranty (GNU GPL).
Options marked produce a lot of output-pipe it through ' less ' or ' more '!
Lack of automatic processing of H files at compile time
sudo auto-apt run./configure
View the temporary storage directory for downloading packages when installing software
Ls/var/cache/apt/archives
Back up the list of all packages currently installed on the system
#危险. Format the first partition as a ext3 partition, Mkfs.reiserfs mkfs.xfs Mkfs.vfat
sudo mkfs.ext3/dev/sda1
Hard drive Check
#危险. Check the first partition, do not check the partitions that are already mounted, or you will easily lose and corrupt data
sudo fsck/dev/sda1
Partition mount
sudo mount-t file system type device path access path
#常用文件类型如下: iso9660 Optical Drive file system, VFAT FAT/FAT32 partition, NTFS NTFS partition, SMBFS Windows network share directory, ReiserFS, ext3, XFS Linux partition
#如果中文名无法显示尝试在最後增加-O Nls=utf8 or-o Iocharset=utf8
#如果需要挂载後, normal users can also use the back of the-o parameter to increase, umask=022 such as:-O nls=utf8,umask=022
sudo hdparm-i/dev/sda
Or
sudo apt-get install Blktool
sudo blktool/dev/sda ID
View the hard drive remaining space
Df
Usage: DF [options] ... [File] ... Displays information about the file system where each < file > resides, by default, by displaying all file systems.
Parameters that must be used with long options are also required when using short options.
-A,--all includes a file system with a size of 0 blocks
-B,--block-size= size block in bytes specified < size >
-H,--human-readable print file system size in an Easy-to-understand format (e.g. 1K 234M 2G)
-H,--si is similar to-H, but takes 1000 of the second party instead of 1024
-I,--inodes display inode information rather than block usage
-K is--block-size=1k
-L,--local only displays the file system of this machine
--no-sync do not synchronize before obtaining usage data (default)
-P,--portability uses a POSIX-compliant output format
--sync to get the usage data before the synchronization action
-T, the--type= type prints only the information specified in the file system for the specified < type >
-T,--print-type print file system type
-X, the--exclude-type= type prints only the file system is not the specified < type > information
-V (ignored)
--HELP Display this help information and leave
--version display version information and leave
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-L Show detailed low and high memory statistics
-O use old format (no-/+buffers/cache line)
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] Times
-V Display version information and exit
Continuous monitoring of memory usage
watch-d Free
# use Ctrl + C to exit
Dynamic display of Process execution
Top
The top command enters H or when running. Open the Help window and enter the Q exit directive.
See what processes are currently
Ps-afl
The memory consumption of the statistic program
Ps-eo Fname,rss|awk ' {arr[$1]+=$2} end {to (I in arr) {print i,arr[i]} ' |SORT-K2-NR
Arrange processes by memory from large to small
Ps-eo "%c:%p:%z:%a" |sort-k5-nr
Arrange processes from large to small by CPU utilization
Ps-eo "%c:%p:%z:%a" |sort-nr
View the current process tree
Pstree
Abort a process
Kill process Number (is the number of the first column in the ps-a)
or killall process name
Force abort a process (used when the above process abort is unsuccessful)
Kill-9 Process Number
or killall-9 process name
Graphical way to abort a program
Xkill appear skull Mark Mouse, click Need to abort the program can
To view files opened by the process
PID of Lsof-p Process
Shows the process of opening a file abc.txt
Lsof Abc.txt
Show 22 Ports What programs are running now
Lsof-i: 22
Show the file that the NSD process is now open
Lsof-c NSD
Running the program in the background, after exiting the login, does not end the program
Nohup Program &
#查看中间运行情况 Tail Nohup
To display the running information of a program in detail
Strace-f-f-o outfile <cmd>
Increase the number of system maximum open files
echo 4096 >/proc/sys/fs/file-max
#或者
Ulimit-n 4096
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.