debian一些命令的应用
时间:2006-02-11 来源:sunowy
######
To remount the partition run:
"mount -o remount /"
######
检测显卡
$glxgears
$glxinfo | grep rendering
######
iconv能转换文件内容的编码
convmv能将整个分区内的文件名转换成另一种编码
######
开机自动打开 数字键盘
打开 /etc/console-tools/config, 文件尾部找到: # Turn on numlock by default LEDS=+num <== 取消此行的注释
######
查找问题所在
当程序出现问题, 但没有给出足够的错误提示时, 可以用下面的命令跟踪:
$strace -f -F -o outfile <cmd>
######
查看软件包的内容:
已安装包
dpkg -L packagename
未安装包
dpkg-deb -c /path/to/debfile
######
改时间
root@0[wide288]# date
日 11月 13 16:57:34 CST 2005
root@0[wide288]# date 11131646
日 11月 13 16:46:00 CST 2005
root@0[wide288]# date
日 11月 13 16:46:04 CST 2005
########
设置日期
#date -s 11/13/05 // mm/dd/yy
设置时间
#date -s 20:02
写入CMOS
hwclock --systohc
读取CMOS时间
hwclock --hctosys
######
用tar命令行解压包中特定文件名的文件:
colinux:~/test# ls
test.tar
colinux:~/test# tar -tvf test.tar
drwxr-xr-x root/root 0 2005-11-17 10:13:37 ./
-rw-r--r-- root/root 16 2005-11-17 10:12:55 ./test2
-rwxr-xr-x root/root 89 2005-11-10 03:23:37 ./test.sh
colinux:~/test# tar --get -vf test.tar test.sh
tar: test.sh: Not found in archive
tar: Error exit delayed from previous errors
colinux:~/test# tar --get -vf test.tar ./test.sh
./test.sh
colinux:~/test# ls -l
total 16
-rwxr-xr-x 1 root root 89 Nov 10 03:23 test.sh
-rw-r--r-- 1 root root 10240 Nov 17 10:13 test.tar
######
apt-cache:
apt-cache 说明: APT软件包处理工具 - 缓存处理器
apt-cache 只能完成对APT软件包缓存的各种操作, 不能处理系统状态, 只是为系统操作提供有用的关联信息. 在命令行给出 -h 或 --help 选项, 以获取帮助
showpkg <package> 列出软件包的相关信息, 以及详细的依赖情况, 包括依赖与被依赖.
show <package> 列出软件包的完整信息描述.
search <pattern> 搜索满足描述的软件包,
search <pattern> --names-only 只匹配软件名
status 列出当前系统缓存状态, 包括软件包数量, 以及相互依赖情况, 等等
depends <package> 列出软件包的依赖列表, 以及可能的解决方案
######
系统服务
1.编写启动脚本, 并将其置于 /etc/init.d/目录下
2. 付予 可执行权限
3. 设定为启动服务
#/usr/sbin/update-rc.d <shell name> defaults
4.将其删除
#/usr/sbin/update-rc.d -f <shell name> remove
5.根据运行级别设定,例如
#/usr/sbin/update-rc.d <shell name> start 20 1 2 3 . stop 20 4 5 .
######
控制台快照
可以用setterm程序来获得控制台下的屏幕截图。命令格式为:
setterm -dump 1
上面命令中,1指第一个虚拟控制台,如要获得第二个虚拟控制台的内容,应改为2,依此类推。
######
修改用户资料
chfn userid
To remount the partition run:
"mount -o remount /"
######
检测显卡
$glxgears
$glxinfo | grep rendering
######
iconv能转换文件内容的编码
convmv能将整个分区内的文件名转换成另一种编码
######
开机自动打开 数字键盘
打开 /etc/console-tools/config, 文件尾部找到: # Turn on numlock by default LEDS=+num <== 取消此行的注释
######
查找问题所在
当程序出现问题, 但没有给出足够的错误提示时, 可以用下面的命令跟踪:
$strace -f -F -o outfile <cmd>
######
查看软件包的内容:
已安装包
dpkg -L packagename
未安装包
dpkg-deb -c /path/to/debfile
######
改时间
root@0[wide288]# date
日 11月 13 16:57:34 CST 2005
root@0[wide288]# date 11131646
日 11月 13 16:46:00 CST 2005
root@0[wide288]# date
日 11月 13 16:46:04 CST 2005
########
设置日期
#date -s 11/13/05 // mm/dd/yy
设置时间
#date -s 20:02
写入CMOS
hwclock --systohc
读取CMOS时间
hwclock --hctosys
######
用tar命令行解压包中特定文件名的文件:
colinux:~/test# ls
test.tar
colinux:~/test# tar -tvf test.tar
drwxr-xr-x root/root 0 2005-11-17 10:13:37 ./
-rw-r--r-- root/root 16 2005-11-17 10:12:55 ./test2
-rwxr-xr-x root/root 89 2005-11-10 03:23:37 ./test.sh
colinux:~/test# tar --get -vf test.tar test.sh
tar: test.sh: Not found in archive
tar: Error exit delayed from previous errors
colinux:~/test# tar --get -vf test.tar ./test.sh
./test.sh
colinux:~/test# ls -l
total 16
-rwxr-xr-x 1 root root 89 Nov 10 03:23 test.sh
-rw-r--r-- 1 root root 10240 Nov 17 10:13 test.tar
######
apt-cache:
apt-cache 说明: APT软件包处理工具 - 缓存处理器
apt-cache 只能完成对APT软件包缓存的各种操作, 不能处理系统状态, 只是为系统操作提供有用的关联信息. 在命令行给出 -h 或 --help 选项, 以获取帮助
showpkg <package> 列出软件包的相关信息, 以及详细的依赖情况, 包括依赖与被依赖.
show <package> 列出软件包的完整信息描述.
search <pattern> 搜索满足描述的软件包,
search <pattern> --names-only 只匹配软件名
status 列出当前系统缓存状态, 包括软件包数量, 以及相互依赖情况, 等等
depends <package> 列出软件包的依赖列表, 以及可能的解决方案
######
系统服务
1.编写启动脚本, 并将其置于 /etc/init.d/目录下
2. 付予 可执行权限
3. 设定为启动服务
#/usr/sbin/update-rc.d <shell name> defaults
4.将其删除
#/usr/sbin/update-rc.d -f <shell name> remove
5.根据运行级别设定,例如
#/usr/sbin/update-rc.d <shell name> start 20 1 2 3 . stop 20 4 5 .
######
控制台快照
可以用setterm程序来获得控制台下的屏幕截图。命令格式为:
setterm -dump 1
上面命令中,1指第一个虚拟控制台,如要获得第二个虚拟控制台的内容,应改为2,依此类推。
######
修改用户资料
chfn userid
相关阅读 更多 +
排行榜 更多 +