grep:查找文件内容命令
cat hello.c | grep "printf" 查找hello.c文件中内容有"printf"关键字
wc:统计字符信息
-l 统计行数
-c 统计字符个数
-w 统计字数,以空格分界
进程操作相关指令
ps: 显示当前系统中由该用户运行的进程列表
kill 输出特定的信号给指定的进程,并根据该信号而完成指定的行为
kill -9 pid 其中-9是一个信号值(1~63)9号信号为杀死的作用
top 动态显示当前系统中由该用户运行的进程列表。5秒更新一次 top -d 2 2秒刷新一次
renice 修改一个正在运行的进程的优先级
pstree 列出当前的进程,以及他们的树状结构
tar:压缩,解压
tar格式:
打包:tar -cvf archive_name.tar directory_to_compress
解压:tar -xvf archive_name.tar.gz
tar.gz格式:
打包:tar -zcvf archive_name.tar.gz directory_to_compress
解压:tar -zxvf archive_name.tar.gz
TAR.BZ2格式:
打包:tar -jcvf archive_name.tar.bz2 directory_to_compress
解压:tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/
cat hello.c | grep "printf" 查找hello.c文件中内容有"printf"关键字
wc:统计字符信息
-l 统计行数
-c 统计字符个数
-w 统计字数,以空格分界
进程操作相关指令
ps: 显示当前系统中由该用户运行的进程列表
kill 输出特定的信号给指定的进程,并根据该信号而完成指定的行为
kill -9 pid 其中-9是一个信号值(1~63)9号信号为杀死的作用
top 动态显示当前系统中由该用户运行的进程列表。5秒更新一次 top -d 2 2秒刷新一次
renice 修改一个正在运行的进程的优先级
pstree 列出当前的进程,以及他们的树状结构
tar:压缩,解压
tar格式:
打包:tar -cvf archive_name.tar directory_to_compress
解压:tar -xvf archive_name.tar.gz
tar.gz格式:
打包:tar -zcvf archive_name.tar.gz directory_to_compress
解压:tar -zxvf archive_name.tar.gz
TAR.BZ2格式:
打包:tar -jcvf archive_name.tar.bz2 directory_to_compress
解压:tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/