Ubuntu12.04环境搭建遇到的问题和使用技巧 (二)

时间:2022-08-31 16:41:43

接上:Ubuntu12.04环境搭建遇到的问题和使用技巧(一)

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

Add 2015.05.27

在Ubuntu上经常会碰到程序无法关闭的情况,这时就需要强制把它杀死

首先使用ps -ef列出进程列表

dzt@uu:~/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环境搭建遇到的问题和使用技巧 (二)

使用命令

dzt@dzt-All-Series:~$ 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

dzt@dzt-All-Series:~$ 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、查看主板信息

dzt@dzt-All-Series:~$ 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.安装后可以使用以下命令

deng@deng-All-Series:~$ ssh dzt@18.8.6.87

登录用户名为:dzt

IP地址为:18.8.6.87的服务器或Linux系统

前提是要有密码

远程复制文件

把dzt中的文件VideoBackgroundController.java复制到deng用户的根目录

deng@deng-All-Series:~$ scp -r dzt@18.8.6.87:dzt/VideoBackgroundController.java ~/

把deng的jackpal.androidterm_095443.apk复制到dzt的根目录下dzt目录

deng@deng-All-Series:~$ scp -r jackpal.androidterm_095443.apk dzt@18.8.6.87:~/dzt