1、避免文件夹拼写错误
shopt命令:
演示一下:
我想进入/home文件夹可是不小心拼写错了:
[fulinux@ubuntu ~]$ cd /hoem
-bash: cd: /hoem: No such file or directory
假设使用了shopt命令情况就不一样了:
[fulinux@ubuntu ~]$ shopt -s cdspell
[fulinux@ubuntu ~]$ cd /hoem
/home
[fulinux@ubuntu home]$ pwd
/home
正确了。
2、删除某个文件或文件夹之外的全部文件或文件夹
3、dpkg 命令来查找头文件所在位置:
[fulinux@ubuntu ~]$ dpkg -S stdio.h
syslinux-common: /usr/lib/syslinux/com32/include/stdio.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/stdio.h
libc6-dev:amd64: /usr/include/stdio.h
libstdc++-4.8-dev:amd64: /usr/include/c++/4.8/tr1/stdio.h
perl: /usr/lib/perl/5.14.2/CORE/nostdio.h
4、ifnames命令查看代码中有哪些条件编译语法:
[fulinux@ubuntu libmodbus-3.1.1]$ ifnames src/*.c
AI_ADDRCONFIG src/modbus-tcp.c
B1000000 src/modbus-rtu.c
B115200 src/modbus-rtu.c
B1152000 src/modbus-rtu.c
B1500000 src/modbus-rtu.c
B230400 src/modbus-rtu.c
B2500000 src/modbus-rtu.c
B3000000 src/modbus-rtu.c
B3500000 src/modbus-rtu.c
B4000000 src/modbus-rtu.c
B460800 src/modbus-rtu.c
B500000 src/modbus-rtu.c
B57600 src/modbus-rtu.c
B576000 src/modbus-rtu.c
B921600 src/modbus-rtu.c
FIONBIO src/modbus-tcp.c
GCC_VERSION src/modbus-data.c
HAVE_ACCEPT4 src/modbus-tcp.c
HAVE_BYTESWAP_H src/modbus-data.c
HAVE_DECL_TIOCM_RTS src/modbus-rtu.c
HAVE_DECL_TIOCSRS485 src/modbus-rtu.c
HAVE_STRLCPY src/modbus.c
MSG_NOSIGNAL src/modbus-tcp.c
OS_BSD src/modbus-tcp.c
OS_WIN32 src/modbus-tcp.c
O_CLOEXEC src/modbus-rtu.c
SOCK_CLOEXEC src/modbus-tcp.c
SOCK_NONBLOCK src/modbus-tcp.c
WINVER src/modbus-tcp.c
_MSC_VER src/modbus-data.c src/modbus-rtu.c src/modbus-tcp.c src/modbus.c
_WIN32 src/modbus-rtu.c src/modbus-tcp.c src/modbus.c
__FreeBSD__ src/modbus-tcp.c
__GNUC__ src/modbus-data.c
__OpenBSD__ src/modbus-tcp.c
bswap_16 src/modbus-data.c
bswap_32 src/modbus-data.c
by fulinux
blog blog.csdn.net/fulinus