UBUNTU one-sentence skills-getting started with Linux (for beginners)

Source: Internet
Author: User
One-sentence UBUNTU tips-getting started with Linux (for beginners)-General Linux technology-Linux technology and application information. For details, refer to the following section. View the installation content of software xxx
Dpkg-L xxx


Search software
Apt-cache search Regular Expression


Find the package of the file
Dpkg-S filename apt-file search filename


Queries which packages the software xxx depends on
Apt-cache depends xxx


Queries which packages depend on the software xxx
Apt-cache rdepends xxx


Add a CD Source
Sudo apt-cdrom add

System Upgrade
Sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade


--------------------------------------------------------------------------------
Automatic Processing of H files is missing during compilation
Sudo auto-apt run./configure


View the temporary directory for storing downloaded packages during software installation
Ls/var/cache/apt/archives

Back up the list of all packages installed in the current system
Dpkg -- get-selections | grep-v deinstall> ~ /Somefile

Restore all packages from the list file of the installation package backed up above

Dpkg -- set-selections <~ /Somefilesudo dselect



Clear old software caches
Sudo apt-get autoclean

Clear all software caches

Sudo apt-get clean



Delete isolated software that is no longer used by the System

Sudo apt-get autoremove

----------------------------------------------------------------------

View the kernel
Uname-

View ubuntu version
Cat/etc/issue

View the modules loaded by the kernel
Lsmod

View PCI devices
Lspci

View Nic status
Sudo ethtool eth0

View USB devices
Lausb

View cpu Information
Vat/proc/cpuinfo

View Current hardware information
Lshw

--------------------------------------------------------------------------------

View Hard Disk Partitions
Sudo fdisk-l

View IDE Hard Disk Information
Sudo hdparm-I/dev/hda

View sata hard disk Information
Sudo hdparm-I/dev/sda
Or sudo apt-get install blktool sudo blktool dev/sda id

Viewing hard disks is better than space
Df-hdf-H

View space occupied by Directories
Du-hs directory name

The USB flash drive cannot be detached.
Syncfuser-km/media/usbdisk

View Current memory usage
Free-l

--------------------------------------------------------------------------------
View Current Process
Ps-

Kill a process
Kill process number (that is, the first column of the number in ps-A or the killall process name)

Force a process to be killed (when the above method fails)
Kill-9 process no. Or killall-9 process name

View the real-time status of the current process
Top

View files opened by a process
Lsof-p

Configure ADSL
Sudo pppoeconf

ADSL Manual dialing
Sudo pon dsl-provider

Activate ADSL
Sudo/etc/ppp/pppoe_on_boot

Disconnect ADSL
Sudo poff

View dialing logs
Sudo plog

View Nic addresses by IP Address
Atping IP Address

View current IP Address
Sudo ifconfig eth0 | awk '/inet addr/{split ($2, x, ":"); print x [2]}'

View the IP address of the current Internet
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 the program listening to port 80
Lsof-I: 80

--------------------------------------------------------------------------------
View the physical address of the current Nic
Sudo arp-a | awk '{print $4 }'
Sudo ifconfig eth0 | head-1 | awk '{print $5 }'

Enable the network to support nat now
Sudo echo 1>/proc/sys/net/ipv4/ip_forward
Sudo iptables-t nat-I POSTROUTING-j MASQUERADE

View route information
Netstat-rn
Sudo route-n

Manually add or delete a route entry
Sudo route add-net 192.168.0.0
Netmask 255.255.255.0 gw 172.16.0.1
Sudo route del-net 192.168.0.0
Netmask 255.255.255.0 gw 172.16.0.1

How to modify the MAC address of a NIC
Sudo ifconfig eth0 down # disable the NIC
Sudo ifconfig eth0 hw ether 00: AA: BB: CC: DD: EE # change the address
Sudo ifconfig eth0 up # Start the NIC

--------------------------------------------------------------------------------
Add a service
Sudo update-rc.d service name defaults 99

Delete a service
Sudo update-rc.d service name remove

Temporarily restart a service
/Etc/init. d/service name restart

Temporarily close a service
/Etc/init. d/service name stop

Configure which Java is used by default
Sudo update-alternatives -- config java

Modify user information
Sudo chfn userid

Set proxy for apt
Export
Http_proxy = http://xx.xx.xx.xx: xxx

Modify system logon information
Sudo vim/etc/motd

Convert the file name from GBK to UTF8
Sudo apt-get install convmv
Convmv-r-f cp936-t utf8 -- notest -- nosmart *

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

Http://softbbs.pconline.com.cn/topic.jsp? Tid = 7287850
Related Article

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.