天天看點

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

接上:Ubuntu12.04環境搭建遇到的問題和使用技巧(一)

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

Add 2015.05.27

在Ubuntu上經常會碰到程式無法關閉的情況,這時就需要強制把它殺死

首先使用ps -ef列出程序清單

[email protected]:~/workarea/8601_mp$ ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 May22 ?        00:00:00 /sbin/init
root         2     0  0 May22 ?        00:00:00 [kthreadd]
root         3     2  0 May22 ?        00:00:06 [ksoftirqd/0]
root         5     2  0 May22 ?        00:00:00 [kworker/0:0H]
root         7     2  0 May22 ?        00:02:54 [migration/0]
root         8     2  0 May22 ?        00:00:00 [rcu_bh]
root         9     2  0 May22 ?        00:00:00 [rcuob/0]
root        10     2  0 May22 ?        00:00:00 [rcuob/1]
root        11     2  0 May22 ?        00:00:00 [rcuob/2]
root        12     2  0 May22 ?        00:00:00 [rcuob/3]
root        13     2  0 May22 ?        00:07:56 [rcu_sched]
root        14     2  0 May22 ?        00:02:12 [rcuos/0]
root        15     2  0 May22 ?        00:01:32 [rcuos/1]
root        16     2  0 May22 ?        00:01:40 [rcuos/2]
root        17     2  0 May22 ?        00:01:55 [rcuos/3]
root        18     2  0 May22 ?        00:00:05 [watchdog/0]
root        19     2  0 May22 ?        00:00:04 [watchdog/1]
root        20     2  0 May22 ?        00:01:19 [migration/1]
root        21     2  0 May22 ?        00:00:03 [ksoftirqd/1]
root        23     2  0 May22 ?        00:00:00 [kworker/1:0H]
root        24     2  0 May22 ?        00:00:03 [watchdog/2]
root        25     2  0 May22 ?        00:01:05 [migration/2]
root        26     2  0 May22 ?        00:00:01 [ksoftirqd/2]
root        28     2  0 May22 ?        00:00:00 [kworker/2:0H]
root        29     2  0 May22 ?        00:00:03 [watchdog/3]
root        30     2  0 May22 ?        00:01:01 [migration/3]
root        31     2  0 May22 ?        00:00:01 [ksoftirqd/3]
root        33     2  0 May22 ?        00:00:00 [kworker/3:0H]
root        34     2  0 May22 ?        00:00:00 [khelper]
root        35     2  0 May22 ?        00:00:00 [kdevtmpfs]
root        36     2  0 May22 ?        00:00:00 [netns]
root        37     2  0 May22 ?        00:00:00 [writeback]
root        38     2  0 May22 ?        00:00:00 [kintegrityd]
root        39     2  0 May22 ?        00:00:00 [bioset]
root        40     2  0 May22 ?        00:00:00 [crypto]
root        42     2  0 May22 ?        00:00:00 [kblockd]
root        43     2  0 May22 ?        00:00:00 [ata_sff]
root        44     2  0 May22 ?        00:00:51 [khubd]
root        45     2  0 May22 ?        00:00:00 [md]
root        46     2  0 May22 ?        00:00:00 [devfreq_wq]
root        49     2  0 May22 ?        00:00:00 [khungtaskd]
root        50     2  0 May22 ?        00:14:45 [kswapd0]
root        51     2  0 May22 ?        00:00:00 [ksmd]
root        52     2  0 May22 ?        00:00:00 [khugepaged]
root        53     2  0 May22 ?        00:00:00 [fsnotify_mark]
root        54     2  0 May22 ?        00:00:00 [ecryptfs-kthrea]
root        66     2  0 May22 ?        00:00:00 [kthrotld]
root        71     2  0 May22 ?        00:00:00 [dm_bufio_cache]
root        90     2  0 May22 ?        00:00:00 [deferwq]
root        91     2  0 May22 ?        00:00:00 [charger_manager]
root       314     2  0 May22 ?        00:00:00 [scsi_eh_0]
root       317     2  0 May22 ?        00:00:00 [scsi_eh_1]
root       318     2  0 May22 ?        00:00:00 [scsi_eh_2]
root       319     2  0 May22 ?        00:00:00 [scsi_eh_3]
root       320     2  0 May22 ?        00:00:00 [scsi_eh_4]
root       321     2  0 May22 ?        00:00:00 [scsi_eh_5]
root       352     2  0 May22 ?        00:00:03 [jbd2/sda1-8]
root       353     2  0 May22 ?        00:00:00 [ext4-rsv-conver]
root       354     2  0 May22 ?        00:00:00 [ext4-unrsv-conv]
root       446     1  0 May22 ?        00:00:00 upstart-udev-bridge --daemon
           

再使用kill pid來殺死對應的程序

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

到新公司後需要在Ubuntu12.04下搭建Android的開發環境,在這個過程中還是會碰到很多問題,在這裡記錄下來,友善自己以後和有需要的人參考。來源于網絡!

10、改變所屬的群組chown -R user1.user2 dir

如果目錄的群組所屬是root的話,在編譯一些檔案有可能會出錯,一般安裝時需要使用root,其它情況不建議使用sudo或root

修改前的D目錄是root使用者

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

使用指令

[email protected]:~$ sudo chown -R dzt.dzt D

修改後的群組所屬dzt,以上指令會周遊D目錄以下的所有目錄

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

檢視Linux系統資訊,Linux系統不像Window系統這麼友善,需要用到一些指令,在這裡收集了一些

1、檢視CPU的核數: cat /proc/cpuinfo | grep "cores" | uniq

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

2、檢視CPU的型号:cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

3、檢視記憶體總數:cat /proc/meminfo | grep MemTotal

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

      檢視記憶體條數:dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

      檢視記憶體最大容量:dmidecode|grep -P 'Maximum\s+Capacity'

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

      檢視記憶體頻率:dmidecode|grep -A16 "Memory Device"|grep Speed

Ubuntu12.04環境搭建遇到的問題和使用技巧 (二)

4、檢視記憶體條型号:dmidecode -t memory

[email protected]:~$ sudo dmidecode -t memory
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0041, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0042
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: ChannelA-DIMM0
	Bank Locator: BANK 0
	Type: Unknown
	Type Detail: None
	Speed: Unknown
	Manufacturer: [Empty]
	Serial Number: [Empty]
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: Unknown
	Configured Clock Speed: Unknown

Handle 0x0042, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 32 GB
	Error Information Handle: Not Provided
	Number Of Devices: 4

Handle 0x0043, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0042
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 8192 MB
	Form Factor: DIMM
	Set: None
	Locator: ChannelA-DIMM1
	Bank Locator: BANK 1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1600 MHz
	Manufacturer: Kingston
	Serial Number: 2E0E070A
	Asset Tag: 9876543210
	Part Number: KHX1600C10D3/8G   
	Rank: 2
	Configured Clock Speed: 1600 MHz

Handle 0x0045, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0042
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: ChannelB-DIMM0
	Bank Locator: BANK 2
	Type: Unknown
	Type Detail: None
	Speed: Unknown
	Manufacturer: [Empty]
	Serial Number: [Empty]
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: Unknown
	Configured Clock Speed: Unknown

Handle 0x0046, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0042
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: ChannelB-DIMM1
	Bank Locator: BANK 3
	Type: Unknown
	Type Detail: None
	Speed: Unknown
	Manufacturer: [Empty]
	Serial Number: [Empty]
	Asset Tag: 9876543210
	Part Number: [Empty]
	Rank: Unknown
	Configured Clock Speed: Unknown
           

5、檢視主機闆資訊

[email protected]:~$ sudo dmidecode|more
# dmidecode 2.11
SMBIOS 2.7 present.
81 structures occupying 3086 bytes.
Table at 0x000EC280.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: 2001
	Release Date: 06/13/2014
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 16384 kB
	Characteristics:
		PCI is supported
		APM is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 4.6

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: ASUS
	Product Name: All Series
	Version: System Version
	Serial Number: System Serial Number
	UUID: 03BC25E0-D83C-11DD-815F-54A050502357
	Wake-up Type: Power Switch
	SKU Number: All
	Family: ASUS MB

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: B85-PLUS
	Version: Rev X.0x
	Serial Number: 140729007605676
	Asset Tag: To be filled by O.E.M.
--更多--
           

12、使用ssh遠端登入Linux系統

1.首先要安裝ssh

2.安裝後可以使用以下指令

[email protected]:~$ ssh [email protected]

登入使用者名為:dzt

IP位址為:18.8.6.87的伺服器或Linux系統

前提是要有密碼

遠端複制檔案

把dzt中的檔案VideoBackgroundController.java複制到deng使用者的根目錄

[email protected]:~$ scp -r [email protected]:dzt/VideoBackgroundController.java ~/

把deng的jackpal.androidterm_095443.apk複制到dzt的根目錄下dzt目錄

[email protected]:~$ scp -r jackpal.androidterm_095443.apk [email protected]:~/dzt