linux note

1. 

查看进程打开的文件:

light32@zangchao:~$ ps
  PID TTY          TIME CMD
 4450 pts/1    00:00:00 bash
 4543 pts/1    00:00:00 ps
light32@zangchao:~$ lsof -a -p 4450 -d txt
COMMAND  PID    USER  FD   TYPE DEVICE SIZE/OFF    NODE NAME
bash    4450 light32 txt    REG   8,10   920788 2621444 /bin/bash
light32@zangchao:~$ 

其中-p表示单个进程, -d对FD标志进行过滤,显示FD标志是txt格式。

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

查看哪些进程正在/home/light32下面活动:

light32@zangchao:~$ lsof /home/light32/
COMMAND    PID    USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
gnome-ses 1936 light32  cwd    DIR   8,10     4096 2883586 /home/light32
gnome-set 1985 light32  cwd    DIR   8,10     4096 2883586 /home/light32
compiz    2005 light32  cwd    DIR   8,10     4096 2883586 /home/light32
syndaemon 2008 light32  cwd    DIR   8,10     4096 2883586 /home/light32
polkit-gn 2018 light32  cwd    DIR   8,10     4096 2883586 /home/light32
nautilus  2019 light32  cwd    DIR   8,10     4096 2883586 /home/light32
gnome-fal 2023 light32  cwd    DIR   8,10     4096 2883586 /home/light32
nm-applet 2027 light32  cwd    DIR   8,10     4096 2883586 /home/light32
bluetooth 2034 light32  cwd    DIR   8,10     4096 2883586 /home/light32
indicator 2037 light32  cwd    DIR   8,10     4096 2883586 /home/light32
python    2040 light32  cwd    DIR   8,10     4096 2883586 /home/light32
cairo-doc 2041 light32  cwd    DIR   8,10     4096 2883586 /home/light32
ibus-daem 2073 light32  cwd    DIR   8,10     4096 2883586 /home/light32

............................

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

查看监听某个端口的进程:

light32@zangchao:~$ lsof -i:80
COMMAND    PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ubuntu-ge 2320 light32    7u  IPv4 119479      0t0  TCP zangchao.local:55010->mistletoe.canonical.com:http (CLOSE_WAIT)
chrome    4216 light32   66u  IPv4 127795      0t0  TCP zangchao.local:40152->tf-in-f139.1e100.net:http (ESTABLISHED)
chrome    4216 light32   86u  IPv4 130859      0t0  TCP zangchao.local:49978->117.79.157.251:http (ESTABLISHED)
chrome    4216 light32   96u  IPv4 127840      0t0  TCP zangchao.local:45749->117.79.157.237:http (ESTABLISHED)
chrome    4216 light32  112u  IPv4 127960      0t0  TCP zangchao.local:50030->117.79.157.251:http (ESTABLISHED)
light32@zangchao:~$ 

可以使用-r 或 +r不断地执行lsof

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

列出用户正在使用的文件:lsof -u light32

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

2.

软链接:ln -s target alias

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

3.

打补丁(补丁在源代码目录下):patch -p1 < [patchfile]

使用:

patch -R < [patchfile] 指定补丁文件的路径和文件名。

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

4.

生成deb包:

#./configure

#make

#checkinstall

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

5.

查看程序的优先级:

light32@zangchao:~$ ps -eo nice,pid,cmd
 NI   PID CMD
  0     1 /sbin/init
  0     2 [kthreadd]
  0     3 [ksoftirqd/0]
  0     5 [kworker/u:0]
  -     6 [migration/0]
  -     7 [watchdog/0]
  -     8 [migration/1]
  0    10 [ksoftirqd/1]
  -    12 [watchdog/1]
  -    13 [migration/2]
  0    15 [ksoftirqd/2]
  -    16 [watchdog/2]
  -    17 [migration/3]
  0    19 [ksoftirqd/3]
  -    20 [watchdog/3]
-20    21 [cpuset]
-20    22 [khelper]
  0    23 [kdevtmpfs]
-20    24 [netns]
  0    26 [sync_supers]
  0    27 [bdi-default]
-20    28 [kintegrityd]
-20    29 [kblockd]
-20    30 [ata_sff]
  0    31 [khubd]
-20    32 [md]
  0    35 [khungtaskd]
  0    36 [kswapd0]
  5    37 [ksmd]
 19    38 [khugepaged]
  0    39 [fsnotify_mark]
  0    40 [ecryptfs-kthrea]
-20    41 [crypto]
-20    49 [kthrotld]
  0    52 [scsi_eh_0]
  0    53 [scsi_eh_1]

  0  2049 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
  0  2053 /usr/lib/gvfs/gvfs-afc-volume-monitor
  0  2065 /usr/lib/notify-osd/notify-osd
  0  2070 /usr/bin/gnome-screensaver --no-daemon

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

改变程序的优先级:nice -n [NO] [program name]

其中NO是-20到19,值越低优先级越高。

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

改变进程优先级:renice [+N降低优先级|-N提高优先级] [process]

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

6.

显示所有环境变量:

light32@zangchao:~$ env
LC_PAPER=zh_CN.UTF-8
ORBIT_SOCKETDIR=/tmp/orbit-light32
LC_ADDRESS=zh_CN.UTF-8
SSH_AGENT_PID=1973
TERMINATOR_UUID=urn:uuid:0c1e20ed-d757-4157-a573-76c54987a934
LC_MONETARY=zh_CN.UTF-8
GIO_LAUNCHED_DESKTOP_FILE_PID=4437
GPG_AGENT_INFO=/tmp/keyring-uX5rtb/gpg:0:1
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=fd5599f6ac3918c7c8f5d0ab00000011-1370567901.10378-373770886

................................

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

显示环境变量:

light32@zangchao:~$ echo $HOME
/home/light32
light32@zangchao:~$ 

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

自定义环境变量:

$export imlight="www.light.com"

$echo $imlight

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

7.

在软件仓库中搜索软件:

light32@zangchao:~$ sudo apt-cache search skype
pidgin-skype - Skype plugin for libpurple messengers
pidgin-skype-dbg - Skype plugin for libpurple messengers (debug symbols)
earcandy - Sound level manager for PulseAudio
skype - client for Skype VOIP and instant messaging service
skype-bin - client for Skype VOIP and instant messaging service - binary files


light32@zangchao:~$ sudo apt-cache search skype cli
skype - client for Skype VOIP and instant messaging service
skype-bin - client for Skype VOIP and instant messaging service - binary files
light32@zangchao:~$ 

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

列出软件包详细信息:

light32@zangchao:~$ sudo apt-cache show skype
Package: skype
Priority: extra
Section: net
Installed-Size: 61
Maintainer: Steve Langasek <steve.langasek@canonical.com>
Architecture: i386
Version: 4.2.0.11-0ubuntu0.12.04.1
Depends: skype-bin
Filename: pool/partner/s/skype/skype_4.2.0.11-0ubuntu0.12.04.1_i386.deb
Size: 15950
MD5sum: 77359141450a4acddac04e29696ba04d
SHA1: 23f02fda03a67c922aa6311d08aac8b74752bc22
Description: client for Skype VOIP and instant messaging service
 Skype is software that enables the world's conversations.  Millions of
 individuals and businesses use Skype to make free video and voice calls,
 send instant messages and share files with other Skype users.  Every day,
 people also use Skype to make low-cost calls to landlines and mobiles.
 .
 * Make free Skype-to-Skype calls to anyone else, anywhere in the world.
 * Call to landlines and mobiles at great rates.
 * Group chat with up to 200 people or conference call with up to 25 others.
 * Free to download.


Package: skype
Status: install ok installed
Priority: extra
Section: partner/net
Installed-Size: 61
Maintainer: Steve Langasek <steve.langasek@canonical.com>
Architecture: i386
Version: 4.1.0.20.0-0ubuntu0.12.04.2
Depends: skype-bin
Description: client for Skype VOIP and instant messaging service
 Skype is software that enables the world's conversations.  Millions of
 individuals and businesses use Skype to make free video and voice calls,
 send instant messages and share files with other Skype users.  Every day,
 people also use Skype to make low-cost calls to landlines and mobiles.
 .
  * Make free Skype-to-Skype calls to anyone else, anywhere in the world.
  * Call to landlines and mobiles at great rates.
  * Group chat with up to 200 people or conference call with up to 25 others.
  * Free to download.
Homepage: http://www.skype.com

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

安装指定版本的软件:sudo apt-get install packagename=er

重新安装软件:sudo apt-get --reinstall install packagename

卸载软件:sudo apt-get remove packagename

卸载软件+清除配置文件:sudo apt-get --purge remove packagename

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

8.

安装DEB软件包:$sudo dpkg -c packagename

查看软件包详细信息:$sudo dpkg -I packagename

查看软件包所包含内容:$sudo dpkg -i packagename

卸载已安装的软件包:$sudo dpkg -r packagename

列出软件包安装的所有文件清单:$sudo dpkg -L packagename

重新配置一个已经安装的软件包:$sudo dpkg-reconfigure packagename

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

9.

配置网络:

$sudo ifconfig eth0 192.168.1.9 netmask 255.255.255.0

$sudo route add default gw 192.168.9.1 eth0 #设置默认网关

$sudo /etc/init.d/networking restart #使参数立即生效

$sudo echo "nameserver=219.150.32.132">/etc/resolv.conf #设置DNS服务器

$vim /etc/networking/interfaces  #编辑interfaces文件

light32@zangchao:~$ cat /etc/network/interfaces 
auto lo
iface lo inet loopback
----------------------------------------------------------------------------

10.

cp -a:保留链接/文件属性/递归复制目录/(相当于-dpR选项组合)

cp -r:递归复制

cp -f:删除已经存在的目标文件而不提示

cp -i:与cp -f相反

cp -p:同时复制修改时间和访问权限

cp -l:不复制,只链接

cp -d:复制时保持链接

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

$cp a.c b.c /opt     #复制a.c和b.c到/opt下

$cp -- -file /opt 等同于 $cp ./-file /opt

$cp -b -S @ a.c  /opt  #复制a.c到/opt目录下 

$cp /dev/cdrom /opt/light.iso #把光盘内容做成iso

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

11.

$mkdir -m 700 /opt/lightfolder #在/opt下建立/lightfolder目录,并且所有者具有读写执行权限

$mkdir -p /opt/a/b/c #递归创建目录

$mkdir -- -a  =$mkdir ./-aa   #创建-aa目录

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

12.

$tar -cvf  /opt/light.tar /etc   #打包不压缩

$tar -zcvf  /opt/light.tar.gz /etc   #打包并gzip压缩

$tar -jcvf  /opt/light.tar.bz2 /etc   #打包并bzip2压缩

$tar -j/ztvf  /opt/light.tar.bz2 /etc   #查看压缩包文件

$tar -jxvf  /opt/light.tar.bz2 /etc/josiah   #仅仅解压light中的josiah文件

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

13.

light32@zangchao:~$ last
reboot   system boot  3.2.0-39-generic Sun Jun  9 08:55 - 11:18  (02:23)    
reboot   system boot  3.2.0-39-generic Sat Jun  8 23:17 - 23:20  (00:02)    
reboot   system boot  3.2.0-39-generic Sat Jun  8 22:44 - 23:02  (00:17)    
reboot   system boot  3.2.0-39-generic Sat Jun  8 21:02 - 22:08  (01:05)    
light32  tty1                          Sat Jun  8 20:54 - down   (00:06)    
light32  tty1                          Sat Jun  8 20:54 - 20:54  (00:00)    
reboot   system boot  3.2.0-39-generic Sat Jun  8 14:12 - 21:00  (06:48)    
reboot   system boot  3.2.0-39-generic Sat Jun  8 10:39 - 11:33  (00:53)    
reboot   system boot  3.2.0-39-generic Fri Jun  7 09:16 - 21:50  (12:33)    
reboot   system boot  3.2.0-39-generic Thu Jun  6 15:59 - 21:53  (05:54)    
reboot   system boot  3.2.0-39-generic Sun Jun  2 22:06 - 23:21  (01:15)    
reboot   system boot  3.2.0-39-generic Sun Jun  2 17:26 - 17:38  (00:11)    
light32  tty1                          Sun Jun  2 17:26 - down   (00:00)    
light32  tty1                          Sun Jun  2 17:26 - 17:26  (00:00)    
reboot   system boot  3.2.0-39-generic Sun Jun  2 17:24 - 17:26  (00:01)    
reboot   system boot  3.2.0-39-generic Sun Jun  2 13:33 - 17:16  (03:43)    
-------------------------------------------------------------------------------------------------

14.

$cmd1;cmd2;cmd3

$cmd1&&cmd2&&cmd3

eg.

$./configure && make && make install

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

15.

$shutter &  =  $shutter  <ctrl+z> && bg
------------------------------------------------------

16.

$cat download.txt

$wget -i download.txt

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

$wget -c http://www.light.com/light.iso

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

17.

light32@zangchao:~$ at 03:00
warning: commands will be executed using /bin/sh
at> 

<ctrl+d>

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

18.

light32@zangchao:~$ uname -a
Linux zangchao.cn@gmail.com 3.2.0-39-generic-pae #62-Ubuntu SMP Wed Feb 27 22:25:11 UTC 2013 i686 i686 i386 GNU/Linux
light32@zangchao:~$ 

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

19.

light32@zangchao:~$ lsb_release -a
LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
light32@zangchao:~$ 

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

20.

light32@zangchao:~$ lsmod
Module                  Size  Used by
snd_seq_dummy          12686  0 
nls_iso8859_1          12617  1 
nls_cp437              12751  1 
vfat                   17308  1 
fat                    55605  1 vfat
usb_storage            39683  1 
pci_stub               12550  1 
vboxpci                22911  0 
vboxnetadp             25616  0 
vboxnetflt             27240  0 
vboxdrv               252228  4 vboxpci,vboxnetadp,vboxnetflt
rfcomm                 38139  0 

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

light32@zangchao:~$ cat /proc/modules
snd_seq_dummy 12686 0 - Live 0x00000000
nls_iso8859_1 12617 1 - Live 0x00000000
nls_cp437 12751 1 - Live 0x00000000
vfat 17308 1 - Live 0x00000000
fat 55605 1 vfat, Live 0x00000000
usb_storage 39683 1 - Live 0x00000000
pci_stub 12550 1 - Live 0x00000000
vboxpci 22911 0 - Live 0x00000000 (O)
vboxnetadp 25616 0 - Live 0x00000000 (O)
vboxnetflt 27240 0 - Live 0x00000000 (O)
vboxdrv 252228 4 vboxpci,vboxnetadp,vboxnetflt, Live 0x00000000 (O)

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

21.

light32@zangchao:~$ modinfo ip_tables
filename:       /lib/modules/3.2.0-39-generic-pae/kernel/net/ipv4/netfilter/ip_tables.ko
description:    IPv4 packet filter
author:         Netfilter Core Team <coreteam@netfilter.org>
license:        GPL
srcversion:     F10155933800DD323B72894
depends:        x_tables
intree:         Y
vermagic:       3.2.0-39-generic-pae SMP mod_unload modversions 686 
light32@zangchao:~$ 

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

22.

light32@zangchao:~$ lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18)
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 05)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 05)
00:1f.2 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA IDE Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 05)
00:1f.5 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 2 port SATA IDE Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 05)
02:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev a1)
03:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)
05:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
light32@zangchao:~$ 

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

23.

light32@zangchao:~$ lspci -v
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)
Subsystem: Acer Incorporated [ALI] Device 0370
Flags: bus master, fast devsel, latency 0
Capabilities: <access denied>
Kernel driver in use: agpgart-intel


00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 00002000-00002fff
Memory behind bridge: ac000000-acffffff
Prefetchable memory behind bridge: 00000000ae000000-00000000bfffffff
Capabilities: <access denied>
Kernel driver in use: pcieport
Kernel modules: shpchp


00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18) (prog-if 00 [VGA controller])
Subsystem: Acer Incorporated [ALI] Device 0371
Flags: bus master, fast devsel, latency 0, IRQ 42
Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
I/O ports at 1800 [size=8]
Expansion ROM at <unassigned> [disabled]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915


00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
Subsystem: Acer Incorporated [ALI] Device 0370
Flags: bus master, fast devsel, latency 0, IRQ 41
Memory at f0804000 (64-bit, non-prefetchable) [size=16]
Capabilities: <access denied>
Kernel driver in use: mei
Kernel modules: mei


00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05) (prog-if 20 [EHCI])
Subsystem: Acer Incorporated [ALI] Device 0370
Flags: bus master, medium devsel, latency 0, IRQ 16
Memory at f0806000 (32-bit, non-prefetchable) [size=1K]
Capabilities: <access denied>
Kernel driver in use: ehci_hcd


00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)
Subsystem: Acer Incorporated [ALI] Device 0370
Flags: bus master, fast devsel, latency 0, IRQ 43
Memory at f0800000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd-hda-intel

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

24.

light32@zangchao:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: 

ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 009: ID 046d:c52f Logitech, Inc. Wireless Mouse M305
Bus 002 Device 004: ID 15d9:0a4c Trust International B.V. USB+PS/2 Optical Mouse
Bus 002 Device 005: ID 0402:9665 ALi Corp. Gateway Webcam
Bus 001 Device 007: ID 0fce:e166 Sony Ericsson Mobile Communications AB 
light32@zangchao:~$ 

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

25.

light32@zangchao:~$ cat /proc/cpuinfo 
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Core(TM) i3 CPU       M 380  @ 2.53GHz
stepping : 5
microcode : 0x2
cpu MHz : 933.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips : 5053.98
clflush size : 64

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

26.

light32@zangchao:~$ ps -aux
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   3656  2088 ?        Ss   08:54   0:01 /sbin/init
root         2  0.0  0.0      0     0 ?        S    08:54   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    08:54   0:04 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S    08:54   0:00 [kworker/u:0]
root         6  0.0  0.0      0     0 ?        S    08:54   0:00 [migration/0]
root         7  0.0  0.0      0     0 ?        S    08:54   0:00 [watchdog/0]
root         8  0.0  0.0      0     0 ?        S    08:54   0:00 [migration/1]
root        10  0.0  0.0      0     0 ?        S    08:54   0:03 [ksoftirqd/1]
root        12  0.0  0.0      0     0 ?        S    08:54   0:00 [watchdog/1]
root        13  0.0  0.0      0     0 ?        S    08:54   0:00 [migration/2]
root        15  0.0  0.0      0     0 ?        S    08:54   0:03 [ksoftirqd/2]
root        16  0.0  0.0      0     0 ?        S    08:54   0:00 [watchdog/2]

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

27.

light32@zangchao:~$ sudo fdisk -l
[sudo] password for light32: 


Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf0b1ebb0


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    62926604    31463271    7  HPFS/NTFS/exFAT
/dev/sda2        62926605   482367689   209720542+   7  HPFS/NTFS/exFAT
/dev/sda3       482369534   976771071   247200769    f  W95 Ext'd (LBA)
/dev/sda5       608204898   713061089    52428096    7  HPFS/NTFS/exFAT
/dev/sda6       713061153   775987694    31463271    7  HPFS/NTFS/exFAT
/dev/sda7       775989248   872380415    48195584   83  Linux
/dev/sda8       872382464   878381055     2999296   82  Linux swap / Solaris
/dev/sda9       482369536   608202751    62916608   83  Linux
/dev/sda10      878383104   976771071    49193984   83  Linux


Partition table entries are not in disk order


Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x449db8b0


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63    62910539    31455238+   7  HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sdb2        62910540   671083244   304086352+   7  HPFS/NTFS/exFAT
Partition 2 does not start on physical sector boundary.
/dev/sdb3       671083245   838850039    83883397+   7  HPFS/NTFS/exFAT
Partition 3 does not start on physical sector boundary.
/dev/sdb4       838850040   976768064    68959012+   7  HPFS/NTFS/exFAT


Disk /dev/sdc: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xccd4ebea


   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63    15523839     7761888+   b  W95 FAT32
light32@zangchao:~$ 

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

28.

light32@zangchao:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda10       47G   11G   33G  25% /
udev            3.8G  4.0K  3.8G   1% /dev
tmpfs           1.6G  1.3M  1.6G   1% /run
none            5.0M  8.0K  5.0M   1% /run/lock
none            3.8G  520K  3.8G   1% /run/shm
/dev/sda9        60G   24G   33G  42% /opt
/dev/sdb4        66G   25G   41G  39% /media/HDANGER60G
/dev/sda2       201G  185G   16G  93% /media/WTOOLS
/dev/sda5        50G   28G   23G  55% /media/WIN7x64
/dev/sdb2       290G  251G   40G  87% /media/HSAFE290G
light32@zangchao:~$ 

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

light32@zangchao:~$ df -h /dev/sda2
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       201G  185G   16G  93% /media/WTOOLS
light32@zangchao:~$ 

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

light32@zangchao:~$ df -h /opt
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda9        60G   24G   33G  42% /opt
light32@zangchao:~$ 

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

29.

light32@zangchao:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          7736       7288        448          0        167       5220
-/+ buffers/cache:       1899       5836
Swap:         2928          0       2928
light32@zangchao:~$ 

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

30.

$sudo gedit /etc/apt/sources.list  末尾添加:deb http://download.skype.com/linux/repos/debian/ stable non-free

$sudo apt-get update

$sudo apt-get install skype

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

31.

$sudo apt-get install dosemu

安装DOS模拟环境

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

light32@zangchao:~$ dosemu
EXPERIMENTAL: using non-zero memory base address 0x110000.
You can use the better-tested zero based setup using
sysctl -w vm.mmap_min_addr=0
as root, or by changing the vm.mmap_min_addr setting in
/etc/sysctl.conf or a file in /etc/sysctl.d/ to 0.
ERROR: MFS: couldn't find root path /media/CDROM
light32@zangchao:~$ 

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

32.

$sudo apt-get install vsftpd

$sudo apt-get install openssh-server

$sudo apt-get install nfs-kernel-server

$sudo apt-get install smbfs

$sudo apt-get install samba

$sudo apt-get install build-essential

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

33.

$man 7 man

$man -k list

$man -f ls

$info

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

34.

<ctrl+alt+f1>

$logout or exit

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

<CTRL+U>  删除整个命令行

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

$wine light.bin

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

$sudo apt-get source mplayer   #下载软件源包

$sudo apt-get build-dep mplayer  #同时获得依赖性文件

$sudo apt-get -f install mplayer  #修复残损软件包

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

35.

$sudo dpkg -i package.deb   #安装软件包

$sudo dpkg -I package.deb  #获得软件包信息

$sudo dpkg -r package.deb   #卸载软件包,如果软件包要求依赖文件,则损坏

$sudo dpkg-query  -l ‘wine’ | grep ‘utils’  #列出wine软件包,并utils

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

$./configure -prefix=/usr/bin    #指定安装目录

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

36.

$chmod +- rwx 421

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

37.

$mount -t ext3 /dev/hda3 /mnt/lightdata

$mount -t iso9660 -o ro,loop=/dev/loop0  light.iso /media/lightcdrom

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

38.

vi

<ctrl+f>

<ctrl+b>

dd

yy

p

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

 


















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值