Debian Common commands-Linux Release Technology-Debian information. For more information, see the following. View the installation content of software xxx
Dpkg-L xxx
How to modify the MAC address of a NIC
Ifconfig eth0 down # disable the NIC
Ifconfig eth0 hw ether 00: AA: BB: CC: DD: EE # change the address
Ifconfig eth0 up # Start the NIC
Count the number of current IP connections
Netstat-na | grep ESTABLISHED | awk ''{print $5}'' | awk-F: ''{print $1}'' | sort | uniq-c | sort-r-n
Netstat-na | grep SYN | awk ''{print $5}'' | awk-F: ''{print $1}'' | sort | uniq-c | sort-r-n
Count the IP addresses of up to 20000 IP packets in the current 100 IP Packets
Tcpdump-tnn-c 20000-I eth0 | awk-F ". "'' {print $1 ". "$2 ". "$3 ". "$4}'' | sort | uniq-c | sort-nr | awk ''$1> 100''
Display Chinese characters in the console
Apt-get install zhcon
Enter zhcon for use.
Quickly search for a file
Whereis filename
Find directory-name file name
View File Types
File filename
Display the last six lines of xxx File
Tail-n 6 xxx
Let tail keep reading the latest content
Tail-n 10-f/var/log/apache2/access. log
View the content between the fifth line (inclusive) and the second line (inclusive) in the file.
Sed-n''5, 10p'/var/log/apache2/access. log
Search for files containing xxx strings
Grep-l-r xxx.
Query xxx commands
Apropos xxx
Man-k xxx
Transfer files through ssh
Scp-rp/path/filename username @ remoteIP:/path # copy the local file to the server
Scp-rp username @ remoteIP:/path/filename/path # download the remote file from the server to the local device
View the applications that read and write a file.
Lsof file name
Change the suffix of all files from rm to rmvb
Rename's/. rm $/. rmvb /''*
Replace uppercase letters in all file names with lowercase letters.
Rename ''tr/A-Z/a-z /''*
Delete a file with a special file name, for example, file name: --help.txt
Rm -- --help.txt or rm./--help.txt
View subdirectories of the current directory
Ls-d */. Or echo */.
Move the files in the current directory that have been accessed in the last 30 days to the upper-level back directory.
Find.-type f-atime-30-exec mv {} ../back \;
Display the files in the current directory within the last 2 hours to 8 hours
Find.-mmin + 120-mmin-480-exec more {}\;
Delete all files modified 30 days ago
Find.-type f-mtime + 30-mtime-3600-exec rm {}\;
Search for and delete the file ending with avi or rm of the guest user.
Find.-name ''' *. avi'''-o-name''' *. rm ''-user''' guest''-exec rm {}\;
The files found do not end with java or xml and are not used for seven days.
Find .! -Name *. java! -Name '*. xml'-atime + 7-exec rm {}\;
Count the number of current files
Ls/usr/bin | wc-w
Count the number of current directories
Ls-l/usr/bin | grep ^ d | wc-l
Display the file name of 2006-01-01 in the current directory
Ls-l | grep 2006-01-01 | awk ''{print $8 }''
Decompress xxx.tar.gz
Tar-zxvf xxx.tar.gz
Decompress xxx.tar.bz2
Tar-jxvf xxx.tar.bz2
Compress aaa bbbdirectory as xxx.tar.gz
Tar-zcvf xxx.tar.gz aaa bbb
Compress aaa bbbdirectory as xxx.tar.bz2
Tar-jcvf xxx.tar.bz2 aaa bbb
Special URI address
* Computer: //-all mounted devices and networks
* Network: //-browse Available Networks
* Burn: // a data virtual directory for burning CDs/DVDs
* Smb: //-available windows/samba Network Resources
* X-nautilus-desktop: //-desktop project and icon
* File: //-local file
* Trash: //-local recycle bin directory
* Ftp: //-FTP folder
* Ssh: //-SSH folder
* Fonts: //-font folder. You can drag the font file here to complete installation. * themes: //-system topic folder
Detailed display of program running information
Strace-f-F-o outfile
Set date
Date-s mm/dd/yy
Set Time
Date-s HH: MM
Write time to CMOS
Hwclock -- systohc
CMOS read time
Hwclock -- hctosys
Synchronize time from the server
Ntpdate time.nist.gov
Ntpdate time.windows.com
Export and import data from mysql
Mysqldump Database Name> file name # Export Database mysqladmin create database name # create database
Mysql database name <file name # import database
What should I do if I forget the mysql root Password?
/Etc/init. d/mysql stop
Mysqld_safe -- skip-grant-tables &
Mysqladmin-u user password ''newpassword ''''
Mysqladmin flush-privileges
Modify the root password of mysql
Mysqladmin-uroot-p password ''your new password''
Download website documentation
Http://www.21cn.com of wget-r-p-np-k
·-R: Create a server directory structure on the local machine;
·-P: Download and display all images of HTML files;
·-Np: only download the contents of the specified directory and Its subdirectories of the target site;
·-K: convert non-relative links to relative links.
How to delete the playback history of a Totem player
Rm ~ /. Recently-used
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.