自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

/dev/null

Hope it helps!

  • 博客(49)
  • 收藏
  • 关注

原创 TensorFlow学习笔记(一)

光复制几个代码到自己机器上跑是没有用的。要理解!公式理解有困难,就用图片辅助理解!MNIST中数字的表示方法什么是one-hot? “One-hot” encoding means that you represent the label “6” by using a vector of 10 values, all zeros but the 6th value which is 1. It

2017-05-31 20:20:28 297

原创 Linux中的bin文件夹

~/bin适合放个人用户的 script/usr/local/bin存放系统中所有用户都可以使用的 script/usr/local/sbin存放管理员的 script/usr/local/目录下大部分情况是放本地用户软件/bin或/usr/bin不是用来放软件的,是用来存放 Linux distribution 专用文件的。

2017-05-31 13:31:07 4800

原创 ubuntu安装deb包(dpkg)

安装sudo dpkg -i DEB_PACKAGE卸载sudo dpkg -r PACKAGE_NAME重新配置已安装的包Reconfigure an existing package例如:sudo dpkg-reconfigure keyboard-configuration在终端输入之后,会进入重新配置keyboard的界面。

2017-05-31 12:31:58 950

原创 vim显示行号

命令::set number

2017-05-30 14:54:33 297

原创 vim搜索结果高亮

命令::set hlsearch

2017-05-30 14:52:41 718

原创 less和vim中使用正则表达式搜索

使用less查看 txt 文件之后,按\可以正则表达式来搜索:less phonelist.txt (232) 298-2265 (624) 381-1078 (540) 126-1980 (874) 163-2885 (286) 254-2860 (292) 108-518 (129) 44-1379 (458) 273-1642 (686) 2

2017-05-30 14:20:48 6272

原创 正则表达式中的Quantifiers

?: Match an element zero or one time例如: colou?r: color或 colour 但不能是 colo2r*: Match an element zero or more times+: Match an element one or more times{}: Match an element a specific number of

2017-05-30 14:03:36 547

原创 正则表达式解英语单词字谜

利用Linux 系统是自带的英语词典 /usr/share/dict/wordsgrep -i '^..j.r$' /usr/share/dict/words查找这样一个单词:5个字母,第3个字母是j,最后一个字母是r。加上参数-i表示不区分大小写。系统给出符合条件的单词是: major Major如果^和$的作用是进行锚定,否则例如:grep -i '^..j.r' /usr/shar

2017-05-30 11:31:49 549

原创 grep正则表达式(二)

任意字符(The Any Character)dot or period character: “.”grep -h '.zip' dirlist*.txt“.”代表任意字符,但是zip不符合,因为”.”必须代表一个字符。所以符合条件的字符串至少要含4个字符。bunzip2bzip2bzip2recovergunzipgzipfunzipgpg-zippreunzipprezipp

2017-05-30 11:24:19 334

原创 grep正则表达式(一)

新建一批 txt 文件:[me@linuxbox ~]$ ls /bin > dirlist-bin.txt[me@linuxbox ~]$ ls /usr/bin > dirlist-usr-bin.txt [me@linuxbox ~]$ ls /sbin > dirlist-sbin.txt[me@linuxbox ~]$ ls /usr/sbin > dirlist-usr-sbin.

2017-05-30 11:04:46 317

原创 Linux中的touch命令总结(一)

touch命令有两个主要功能:改变 timestamps新建空白文件例如,不带任何参数地输入:touch file1 file2 file3将在当前目录下新建三个空白文件:file1, file2, file3。如果当前目录已经存在file4,那么:touch file4会把 file4 的 last access time 改成当前时间。

2017-05-29 20:30:39 1198

原创 find命令进阶(三):xargs

The xargs command performs an interesting function. It accepts input from standard input and converts it into an argument list for a specified command. xargs的作用是:接收 input,转换成 argument list(一列参数),由命令分别

2017-05-29 20:00:07 1267

原创 find命令进阶(二):对找到的文件执行操作exec

以下面的命令为例:find ~ -type f -name 'foo*' -exec ls -l '{}' ';'分面两部分,第一部分:find ~ -type f -name 'foo*'即按照通配符foo*查找用户目录下的 regular files。第二部分:-exec ls -l '{}' ';'-exec是一条件命令,{}代表查找到的文件的路径,对这些路径下的文件执行操作ls -l,最后用

2017-05-29 19:48:16 2735

原创 find命令进阶用法(一)

-cmin n: 查找 exactly n 分钟前内容或属性被最后修过的文件-cnewer file: 查找内容或属性的最后修改时间晚于file文件的文件-ctime n: 查找 n*24小时前被内容或属性被最后修改过的文件-empty: 查找空文件和目录-group name: 查找属于group的文件或目录-iname pattern: 相当于-name,但是不考虑大小写-inum

2017-05-29 19:05:02 981

原创 find按照文件大小查找

例如,find -size +1M:查找大于 1 MB 的文件。其他参数:b: 512-byte blocks. This is the default if no unit is specified.c: Bytesw: 2-byte wordsk: KilobytesM: MegabytesG: Gigabytes

2017-05-29 18:49:55 2487

原创 find命令查找目录

find <path> -type d -name "dir_name"-type d是查找目录的参数,如果是查找其他的:-type b: Block special device file-type c: Character special device file-type f: Regular file-type l: Symbol link

2017-05-29 18:44:43 4722

原创 什么是ppa

What is ppa? PPAs are for non standard software/updates. They are generally used by people who want the latest and greatest. If you are going extra lengths to get this kind of software, then you are

2017-05-29 18:41:54 1398

原创 Linux进程管理命令

常用的两个命令 ps: 当前进程(snapshot) top: 动态显示当前进程其他命令: pstree: 显示进程树 vmstat: 显示系统资源使用情况(Ctrl + c退出) xload: 图形窗口显示系统荷载 tload: 终端窗口显示系统荷载

2017-05-29 10:40:10 298

原创 kill命令的几种信号

1 HUP: hangup2 INIT: 相当于 Ctrl + c9 KILL15 TERM: Terminate (kill 的默认信号)18 CONT: Continue (从STOP信号中恢复)19 STOP: Stop

2017-05-29 10:29:50 5375

原创 head、tail 命令和实时(real-time)更新

head、tail 命令和实时(real-time)更新head filename: 输出 filename 文件的前10项tail filename: 输出 filename 文件的后10项即默认输出10项。可以自定义输出项,通过-n参数:head -n 5 filename: 输出 filename 文件的前5项。tail命令还具有实时(real-time)更新并输出最新添加项(appended

2017-05-29 09:45:07 1121

原创 输出匹配项:grep

命令格式:grep pattern [file...]When grep encounters a “pattern” in the file, it prints out the lines containing it.也就是说,grep 命令的功能是,如果 file 中存在于 pattern 匹配的项,则输出。举例说明:ls /bin /usr/bin | sort | uniq | grep

2017-05-29 09:43:42 2420

原创 通过ssh访问虚拟机中的ubuntu系统

首先把 network 连接方式由 NAT 改为 Bridge Adapter,这样虚拟机中的 ubuntu 就可以有独立的 IP 地址。安装 openssh:sudo apt-get install openssh-server此时默认 ssh 服务会启动。查询命令:sudo ps -e | grep ssh如果看到1760 ? 00:00:00 ssh-agent3157 ?

2017-05-29 09:40:18 934

原创 Shell输入命令时一些有用的快捷键

Ctrl + u: 从光标所在位置一直删除到开头 Ctrl + k: 从光标所在位置一直删除到尾Ctrl + b: 光标向后移动一个字符 Ctrl + f: 光标后前移动一个字符Alt + b: 光标向后移动一个词 Alt + f: 光标向前移动一个词Ctrl + y: 在光标处粘贴刚被删掉的部分命令补全Alt + *: 键入所有符合补全条件的部分,例如echo ./D此时按下Alt + *(

2017-05-28 22:12:01 722

原创 读取全名带空格的文件或文件夹

假设当前目录下有一个文件file name.txt。使用vim file name.txt是不能打开这个文件的,shell 默认会丢掉中间的空格。想要读取这个文件,要使用下面这个命令:vim "file name.txt"当然更正确的方法是不要这样全名文件。在双引号中,以下符号会被原样保留地读取:空格(word-splitting)路径名扩展(pathname expansion)~ (til

2017-05-28 20:22:19 1694

原创 Linux中的帮助命令

Linux 的 Shell 中可以使用的帮助命令有好几种:help command: get help for shell builtinscommand --help: display usage informationman command: display a command’s manual pageapropos command: display appropriate comma

2017-05-28 19:51:40 332

原创 Linux批量新建文件夹(大括号表达式的应用)

如果想要批量新建文件夹来存放照片,按照年份和月份,格式为YYYY-MM。可以使用下面命令批量新建:mkdir {2007..2009}-{01..12}结果如下:2007-01 2007-07 2008-01 2008-07 2009-01 2009-07 2007-02 2007-08 2008-02 2008-08 2009-02 2009-08 2007-03 2007-09 2008-03

2017-05-28 19:41:49 1487

原创 macOS系统安装gnuplot(解决Terminal type set to unknown)

macOS 下使用 Homebrew 安装 gnuplotbrew install gnuplot在 terminal 中输入gnuplot进入模式之后,提示Terminal type set to unknown,不能 plot。解决方法:brew uninstall gnuplotbrew install gnuplot --with-x11重新在 terminal 中输入 gnuplot发现

2017-05-28 18:45:49 5035 1

原创 Linux下安装gnuplot

sudo apt-get install gnuplot但是在 terminal 里面输入:gnuplot提示 Terminal type set to unknown。解决方法是安装 x11:sudo apt-get install gnuplot-x11

2017-05-28 18:39:34 6992

原创 Linux中的uniq命令(去掉重复项,输出重复项)

ls /bin /usr/bin | sort | uniq | less上面这条命令的实际效果是:获得 ls /bin /usr/bin 的 output将上述 output 进行 sort (排序),并去掉重复项 (uniq)将经过以上处理的 output 作为 less 命令的 input,输出在屏幕上相反地,如果想输出重复项,使用以下命令:ls /bin /usr/bin | sor

2017-05-28 16:33:28 20786

原创 pipelines和重定向命令

pipelines:command1 | command2例如,ls -l /usr/bin | less,将输出结果作为 less 命令的输入结果,在standard output 中显示出来。管道命令 “|” 和重定向命令 “>” 的区别 the redirection operator connects a command with a file while the pipeline op

2017-05-28 16:24:02 300

原创 Linux的cat命令详解

The cat command reads one or more files and copies them to standard output 也就是说,cat命令读取文件,并显示在 standard output 中。正常情况下,也就是显示在屏幕上。cat 的另一个功能是 concatenate, 连接。如下面这条命令: cat movie.mpeg.0* > movie.mpeg将

2017-05-28 16:10:06 4220

原创 Linux重定向命令(stdout, stdin, stderr)

ls -l /usr/bin > ls-output.txt 将输出结果重定向到 ls-output.txt 文件。注意:再次使用> ls-output.txt会默认覆盖源文件。如果要追加输出信息到文件末尾,使用:ls -l /usr/bin >> ls-output.txt。在shell中,standard input, output 和 error 分别对应于file descriptors

2017-05-28 15:57:34 7431

原创 Linux中Hard link和Symbol link的区别

Hard linkHard link不能指向不在同一磁盘的文件Hard link不能指向目录Hard link与源文件几乎没有区别。只能通过ls -li看出link关系。另外,删除源文件后,Hard link文件仍然存在,保留了源文件的内容。Symbol link可以指向文件夹和不在同一磁盘的文件删除源文件后,Symbol link**仍然存在,但是内容不存在**。

2017-05-28 11:46:31 4076

原创 Linux复制命令cp进阶

cp -a:连同属性和权限也一起复制 cp -i:如果不带该参数,默认覆盖同名文件而不会提醒。 cp -u:只拷贝符合以下条件的文件到目标目录:目标目录中不存在的文件或目标目录中文件版本较旧的文件。

2017-05-28 11:04:52 3480 2

原创 "less is more",用"less”命令查看linux文本文件

less filename:可以方便地查看文本文件

2017-05-28 10:51:30 358

原创 Linux文件权限读法

-rw-r--r--开头以“-”(a leading dash) 开头表示文件类型为 a regular file以”d”开头表示是文件夹,如-rw-r--r--。之后,前三个字母表示文件拥有者的权限,rw-,后三个字母表示文件所在group成员的权限,r--,最后三个字母表示所有人拥有的权限,r--。

2017-05-28 10:32:21 837

原创 Linux命令"ls"进阶说明

pwd:the current working directorycd -: return to the previous working directoryFilenames that begin with a period character are hidden. 使用ls不会显示 这些文件,必须使用ls -a。By adding -l to the commandls -l, we c

2017-05-28 10:26:53 852

原创 Ubuntu14.04安装Ruby2.2方法

直接使用系统的sudo apt-get install ruby2.0安装后,ruby -v显示ruby的版本依然是ruby 1.9.以下方法可以顺序地在Ubuntu14.04安装Ruby2.2sudo apt-add-repository ppa:brightbox/ruby-ngsudo apt-get updatesudo apt-get install ruby2.2测试有效。

2017-05-26 17:30:50 1044

原创 Ubuntu查找软件

查找软件:apt-cache search <your search item>

2017-05-26 17:28:19 754

原创 Using If/Truth Statements with pandas¶

pandas follows the numpy convention of raising an error when you try to convert something to a bool. This happens in a if or when using the boolean operations, and, or, or not. It is not clear what the

2017-05-26 16:49:13 393

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除