1: In a recent Apple laptop to do a dual system, start the computer is still pretty cool, but after ubuntu system well, no wifi icon, then must be connected to a wired network, update packet can.
2: commonly used commands
View software installed xxx content
#dpkg -L xxx
Find software
# apt-cache search regular expression
to find files belong to which package
#dpkg -S filename apt-file search filename
Xxx query software packages which depend
# apt-cache depends xxx
Xxx query software package which is dependent
# apt-cache rdepends xxx
A disc source increases
#sudo apt-cdrom add
系统升级
#sudo apt-get update
#sudo apt-get upgrade
#sudo apt-get dist-upgrade
Therefore, removal of the package clears the residual profile
#dpkg -l | grep ^ rc | awk '{print $ 2}' | tr [ "" n "] [" "] | sudo xargs dpkg -P -
H file is missing compile-time automatic processing
#sudo auto-apt run ./configure
Download the software installation package when you view the temporary storage directory
#ls / var / cache / apt / archives
All current backup system installation package list
#dpkg -get-selections | grep -v deinstall > ~ / somefile
The above list of files from the backup installation package to recover all packet
#dpkg -set-selections <~ / somefile sudo dselect
Clean up old versions of the software cache
#sudo apt-get autoclean
Clean up all the software cache
#sudo apt-get clean
Delete orphaned software system no longer in use
#sudo apt-get autoremove
View package in the server address above
# apt-get -qq -print-uris install ssh | cut -d " '-f2
system
Viewing the kernel
#uname -a
View Ubuntu version
#cat / etc / issue
Viewing the kernel module loaded
#lsmod
View PCI devices
#lspci
Check the USB device
#lsusb
View Card status
#sudo ethtool eth0
View CPU information
#cat / proc / cpuinfo
Displays the current hardware information
#lshw
hard disk
View the hard disk partition
#sudo fdisk -l
Check IDE hard disk information
#sudo hdparm -i / dev / hda
Check the STAT hard drive information
#sudo hdparm -I / dev / sda
or
# sudo APT-GET install blktool
# sudo blktool / dev / sda the above mentioned id
View hard disk space
# df--h
# df--H
Check the directory space
#du -hs directory name
USB flash drives can not uninstall
#sync fuser -km / media / usbdisk
RAM
View the current memory usage
#free -m
process
See which processes are currently
#ps -A
Suspend a process
#kill process ID (that is, digital ps -A in the first column) or killall process name
Forced to kill a process (suspend unsuccessful in the above process when using)
# kill -9 process ID or killall -9 process name
Suspend a program graphically
mouse skull logo #xkill appears, click on the need to suspend the program
View real-time status of the current process
#top
View the process open files
#lsof -p
ADSL Configuration ADSL
# sudo pppoeconf
ADSL manual dial
#sudo pon dsl-provider
Activate ADSL
# sudo / etc / ppp / pppoe_on_boot
Disconnect the ADSL
# sudo Poff
View Dial log
#sudo plog
How to set dynamic domain name
# http://www.3322.org first to apply a dynamic domain name
# then modify / etc / ppp update domain name when ip-up increase dialing / command sudo vim / etc / ppp / ip-up
# at the end Add the following line w3m -no-cookie -dump
The internet
According to the investigation NIC IP address
#arping IP address
Check the current IP address
#ifconfig eth0 | awk '/ inet / {split ($ 2, x, ":"); print x [2]}'
查看当前外网的IP地址
#w3m -no-cookie -dumpwww.edu.cn|grep-o‘[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}’
#w3m -no-cookie -dumpwww.xju.edu.cn|grep-o’[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}’
#w3m -no-cookie -dump ip.loveroot.com|grep -o’[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}".[0-9]"{1,3"}’
View current monitor port 80 program
#lsof -i: 80
View the current physical address of the card
#arp -a | awk '{print $ 4}' ifconfig eth0 | head -1 | awk '{print $ 5}'
Now let network support NAT
# sudo echo 1> / proc / SYS / NET / ipv4 / ip_forward
# sudo iptables -t NAT the -I POSTROUTING -j MASQUERADE
View the routing information
#netstat -rn sudo route -n
Manually add a route to delete
# sudo route the Add -net 172.16.0.1 gw 192.168.0.0 255.255.255.0 Netmask
# sudo route del -net 172.16.0.1 gw 192.168.0.0 255.255.255.0 Netmask
Modify the network card MAC address method
#sudo ifconfig eth0 down close NIC
#sudo ifconfig eth0 hw ether 00: AA : BB: CC: DD: EE then change the address
# sudo ifconfig eth0 up and then start the card
Count the number of the current IP connection
#netstat -Na | grep the ESTABLISHED | awk '{}. 5 Print $' | awk -F: '{}. 1 Print $' | Sort | the uniq -C | -R & lt -n Sort
#netstat -Na | grep SYN | awk '{print $ 5}' | awk -F: '{print $ 1}' | sort | uniq -c | sort -r -n
Current statistics 20,000 IP packets greater than 100 the IP address of the IP packet
#tcpdump -tnn -c 20000 -i eth0 | awk -F '{print $ 1 $ 2 $ 3 $ 4 "." "." "."}' "." | sort | uniq -c | sort -nr | awk '$ 1> 100'
Shield IPV6
#echo "blacklist ipv6" | sudo TEE /etc/modprobe.d/blacklist-ipv6
service
Adding a service
#sudo update-rc.d service name defaults 99
To delete a service
#sudo update-rc.d name remove Service
Temporary restart a service
# / etc / init.d / service name restart
Temporarily shut down a service
# / etc / init.d / service name stop
Temporary start a service
# / etc / init.d / service name start
Set up
Configure the default Java which use
#sudo update-alternatives -config java
Modify user information
#sudo chfn userid
Apt to set up a proxy
#export http_proxy = http: //xx.xx.xx.xx: xxx
Modify the system login information
#sudo vim / etc / motd
Chinese
GBK to convert the file name from the UTF8
# sudo APT-GET install cp936 convmv convmv -r -f -t utf8 -notest -nosmart *
Batch conversion of all files from the contents of src directory GBK to the UTF8
#find src -type -exec mkdir -p UTF8 D / {} "; src -type Find -exec iconv -f F {} -o GBK the UTF8 -t utf8 / {} "; mv utf8 / * src rm -fr utf8
GBK conversion by the contents of the file to UTF8
#iconv -f -t utf8 $ GBK i> newfile
Mp3 conversion tag encoding
#sudo apt-get install python-mutagen find -iname "* .mp3" -execdir mid3iconv -e GBK {} ".;
Chinese display console
when #sudo apt-get install zhcon use, you can enter zhcon
file
Quickly find a file
#whereis filename
#find directory -name filename
Check the file type
#file filename
6 displays the contents of the penultimate line of the xxx file
#tail -n 6 xxx
Let tail constantly read the latest content
#tail -n 10 -f /var/log/apache2/access.log
See the fifth intermediate file line (inclusive) through 10 (inclusive) content
#sed -n '5,10p' /var/log/apache2/access.log
Find the file that contains the string xxx
#grep -l -r xxx.
A comprehensive search for a file (the desktop visualization)
the GNOME-Search-Tool
Xxx Find command on the
#apropos xxx man -k xxx
Transfer files via ssh
#scp -rp / path / filenameusername @ remoteip: / path
# copy local files to the server
#scp -rpusername @ remoteip: / path / filename / path
# to download files from a remote server to the local
View a file is read which applications
#lsof file name
The suffix to all files by rm RMVB
#rename 'S / .rm $ /. RMVB /' *
All the file names in uppercase to lowercase
#rename 'tr / AZ / az / ' *
Delete specific file names, such as file name: -help.txt
#rm - -help.txt or rm ./-help.txt
View the current directory subdirectories
#ls -d * /. Or echo * /.
Move the file in the current directory is accessed last 30 days back to the parent directory
#find -type f -atime -30 -exec mv { } ../back ".;
The latest current directory are displayed from 2 hours to 8 hours up file
#find -mmin +120 -mmin -480 -exec more { } ".;
Remove the 30 days prior to the modification time of all files
#find -type f -mtime +30 -mtime -3600 -exec rm {} ".;
Avi guest user to find a file or removed and ending rm
#find -name '* .avi' -o -name '* .rm' -user 'guest' -exec rm {} ".;
Looking for does not end with java and xml, and delete files without the use of seven days off
#find -name * .java -name '* .xml ' -atime +7 -exec rm {} ".!!;
Current statistics the number of files
#ls / usr / bin | wc -w
Statistics current directory number
#ls -l / usr / bin | grep ^ d | wc -l
Current directory are displayed in the file name 2006-01-01
#ls -l | grep 2006-01-01 | awk ' {print $ 8}'