常用的牛逼的编辑器以及编辑器之间的区别和优缺点:
是各个发行版本都有的编辑器,类似于windiws的记事本,不过可以根据代码类型着色
vim是一个非常强大的编辑器,但是上手难度非常高,有很多个快捷键,对于初学者来说很困难
KomodeEdit是一个非常强大的编辑器,和Notepad++一般。
ULtraEdit是一个商业编辑器,是付费的,用户数量较多,类似于一个标准的ide工具
Geany是一个类似于KomodeEdit的编辑器,适用于C,C++等多种语言
BlueFish:
功能相对较少,只适合一般的网页编辑
可以称得上是ide的编辑器,类似于vim,但是比vim好看,功能更全面,非常适合js python php的开发
常用的编译器:
c/c++ : icc是美国 Intel 公司开发的 C/C++编译器,适用于Linux、Microsoft Windows 和 Mac OS X 操作系统。
java:sun公司的java 9,其最大的特性是模块化,JShell 交互式的java,改进了Stream API,多版本兼容JAR
调试的时候需要编译选项中添加 -g的原因 :
format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this
debugging information.
On most systems that use stabs format, -g enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other
debuggers crash or refuse to read the program. If you want to
control for certain whether to generate the extra information, use
-gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
GCC allows you to use -g with -O. The shortcuts taken by optimized
code may occasionally produce surprising results: some variables
you declared may not exist at all; flow of control may briefly move
where you did not expect it; some statements may not be executed
because they compute constant results or their values were already
at hand; some statements may execute in different places because
they were moved out of loops.
Nevertheless it proves possible to debug optimized output. This
makes it reasonable to use the optimizer for programs that might
have bugs.
The following options are useful when GCC is generated with the
capability for more than one debugging format.
这段话的意思是:
在大多数系统上,都使用了stabs格式,-g允许使用额外的调试只有gdb才能使用的信息;此额外信息
使调试在gdb中工作得更好,但可能会使其他调试器崩溃或拒绝读取程序。如果你想控件是否生成额外信息,请使用-gsings,-gimps,-gxcoff,-gxcoff,或-gvms(见
下文)。所以是只有使用了-g才可以使用gdb调试程序。
readelf命令:
用来显示一个或者多个elf格式的目标文件的信息,
彩色进度条:
#include<stdio.h>
#include<unistd.h>
int main(){
int i = 0;
char bar[102] = {'\0'};
for(; i<101;i++) {
bar[i] = ' ';
printf( "\033[44;37m%d%%%s\033[0m\r", i, bar);
fflush(stdout);
usleep(100000);
}
printf("\n");
return 0;
}
rpm安装和yum安装的区别:
安装包都是以rpm结尾的。
yum是从网络安装源(例如网易镜像,可以自己配置)上下载rpm,如果存在依赖关系会把依赖的rpm同时下载安装。
rpm是安装本地存在的rpm包,如果存在依赖也需要安装上,如果某个rpm是自己修改编译的,那么只能用rpm安装了