10 2020 档案
摘要:TCPWrappers是RHEL7系统中默认启用的一款流量监控程序,它能够根据来访主机的地址与本机的目标服务程序作出允许与拒绝的操作。换句话说,Linux系统中其实有两个层面的防火墙, 第一种是前面讲到的基于TCP/IP协议的流量过滤工具, 而TCPWrapper服务则是能允许或禁止Linux系统提
阅读全文
摘要:firewall-config是firewalld防火墙管理工具的GUI(图形用户界面)版本,几乎可以实现所有以命令行来执行的操作(linux就该这么学p164)。 firewall-config的界面如下图(在终端直接运行firewall-config即弹出),其功能如下: 1:选择运行时(Run
阅读全文
摘要:linux系统中firewalld防火墙拥有基于CLI(命令行界面)和基于GUI(图形用户界面)两种管理方式。 相较于传统的防火墙管理配置工具,firewalld支持动态更新技术并加入了区域(zone)的概念。简单来说,区域就是firewalld预先准备了几套防火墙策略集合(策略模板) 用户可以根据
阅读全文
摘要:策略以规则链: 防火墙会从上至下的顺序来读取配置的策略规则,在找到匹配项后就立即结束匹配工作并去执行匹配项中定义的行为(即方形或者阻止)如果在读取完所有的策略规则之后没有匹配项,就去执行默认的策略。 一般而言,防火墙策略规则的设置有两种:一种是“通”(即放行),一种是“堵”(即阻止)。 iptabl
阅读全文
摘要:防火墙作为公网和内网之间的保护屏障,在保障数据安全性方面起着至关重要的作用。 相较于企业内网,外部的公网环境更加恶略,罪恶丛生。在公网和企业内网之间充当保护屏障的防火墙虽然有软件和硬件之分,但主要功能都是依据策略 对穿越防火墙自身的流量进行过滤。防火墙策略可以基于流量的源目地址、端口号、协议、应用信
阅读全文
摘要:在生产环境中想要重新部署LVM或者不再需要使用LVM时,则需要执行LVM的删除操作。为此,需要提前备份好重要的数据, 然后依次删除逻辑卷、卷组、物理劵设备,顺序不可颠倒。 1、查看物理劵、卷组、逻辑卷 [root@linuxprobe dev]# pvdisplay | head -n 3 Phys
阅读全文
摘要:LVM还具备有“快照劵”功能,该功能类似于虚拟机软件的还原时间点功能。例如,可以对某一个逻辑卷设备做一次快照,如果日后发现数据被改错了,就可以 利用之前做好的快照劵进行覆盖还原。LVM的快照劵功能有两个特点: 快照劵的容量必须等同于逻辑卷的容量。 快照劵仅一次有效,一旦执行还原操作后则会被立即自动删
阅读全文
摘要:相较于扩容逻辑卷,在对逻辑卷进行缩容操作时,其丢失数据的风险更大。所以在生产环境中执行相应操作时,一定要提前备份好数据。另外linux系统规定,在对 LVM逻辑卷进行缩容操作之前,要先检查文件系统的完整性(为了数据安全)。在执行缩容之前先把文件系统卸载。 1、卸载逻辑卷设备的挂载 [root@lin
阅读全文
摘要:1、卸载逻辑卷的挂载 [root@linuxprobe dev]# df -h ## 查看挂载 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 18G 2.9G 15G 17% / devtmpfs 985M 0 98
阅读全文
摘要:部署逻辑卷的目的是实现用户对硬盘资源进行动态调整。(实现???) 部署LVM时,需要逐个配置物理劵、卷组和逻辑卷。 常用的LVM部署命令见下图:(linux就该这么学p145) 部署逻辑卷 1、首先添加两块硬盘 [root@linuxprobe dev]# cd /dev [root@linuxpr
阅读全文
摘要:1、问题 [root@linuxprobe linuxprobe]# screen -S test ## RHEL8自身不带screen bash: screen: command not found... Failed to search for file: Cannot update read-
阅读全文
摘要:在硬盘分好区或者部署为RAID磁盘阵列之后,再想修改硬盘分区大小就不容易了。换句话说,当用户想要随着实际需求的变化调整硬盘分区的大小时,会 受到硬盘“灵活性”的限制。这时就需要用到另外一项非常普及的硬盘设备资源管理技术了 LVM(逻辑卷管理器)。LVM可以允许用户对硬盘资源进行动态调整。 逻辑卷管理
阅读全文
摘要:linux系统中 RAID10 磁盘阵列由两个RAID1+一个raid0组成,当其中一个raid1中的两块硬盘同时损坏时,数据就无法恢复了。(应该是最简单情况) 这种情况下,我们可以使用RAID备份盘技术来预防这类事故的发生。 RAID备份盘技术的核心理念就是准备一块足够大的硬盘,这块硬盘平时处于闲
阅读全文
摘要:linux系统中部署RAID10磁盘阵列的目的是: 提高硬盘的读写速度(IO性能) 提高数据的安全性(冗余数据备份机制) linux系统中raid10磁盘阵列中,当发现一块硬盘出现损坏而不能继续使用时,应当使用mdadm命令将其移除(期间不影响硬盘的使用),然后替换上新的硬盘 1、查看当前系统的ra
阅读全文
摘要:部署raid10磁盘阵列至少需要4快硬盘。 linux系统中,使用mdadm命令创建和管理软件RAID磁盘阵列。 测试:使用mdadm命令创建raid10,名称为/dev/md0 1、测试 [root@linuxprobe dev]# pwd ## 查看当前路径 /dev [root@linuxpr
阅读全文
摘要:1、查看当前硬盘 [root@linuxprobe dev]# cd /dev [root@linuxprobe dev]# find sd* ## 仅有一块硬盘 sda sda1 sda2 2、关闭虚拟机,打开虚拟机管理页面 3、点击编辑虚拟机设置 4、点击添加 5、选硬盘、点下一步 6、选SCS
阅读全文
摘要:CPU及缓存技术(内存)速度发展很快,而硬盘设备的性能提升却不是很大,因此硬盘逐渐成为当代计算机性能提升的瓶颈。 硬盘设备需要进行持续、频繁、大量的IO操作,损害几率较大。 1988年,加利福尼亚大学伯克利分校首次提出并定义了RAID技术的概念。 RAID技术通过把多个硬盘设备组合成一个容量更大、安
阅读全文
摘要:linux系统中软链接相当于windows系统中的快捷方式,实质为原始文件的所在的绝对路径 硬链接相当于针对原始文件的存放位置创建了一个指针(linux就该这么学p132) 硬链接相当于同一个文件的两个名字。 1、准备测试数据 [root@linuxprobe test]# seq 5 > a.tx
阅读全文
摘要:linux系统是多用户、多任务的操作系统,但是硬件的资源是固定而且有限的,如果某些用户不断地在linux系统上创建文件或者存放电影,硬盘空间总有一天会被占满。 针对这种情况,root用户就需要使用磁盘容量配额服务来限制某位用户或某个用户组针对特定文件夹可以使用的最大硬盘空间或最大文件个数,一旦达到这
阅读全文
摘要:swap交换分区是一种通过在硬盘中预先划分一定的空间,然后把内存中暂时不常用的数据临时存放在硬盘中,以便腾出物理内存空间让更活跃的程序服务来 使用的技术,其设计的目的是解决真实物理内存不足的问题。但由于交换分区毕竟是通过硬盘设备读写数据的,速度肯定要比物理内存满,所以只有当真实的 物理内存耗尽后才会
阅读全文
摘要:linux系统中du命令用于统计文件和目录所占用的磁盘空间的大小 1、创建测试数据 [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=10240 of=a.txt ## 创建一个大小为10MB的测试文件 10240+0 records in
阅读全文
摘要:linux系统中外接硬盘的使用逻辑: 磁盘分区 分区格式化 挂载 linux系统中一台主机上可以有多快硬盘,内核中的udev设备管理器会自动对识别的硬盘进行命名 系统采用a~p来代表16块不同的硬盘(默认从a开始),如/dev/sda 代表系统识别的同种型号接口的第一块硬盘, /dev/sdb代表系
阅读全文
摘要:linux系统中硬盘、光驱等联系系统时,并不能直接访问,需要进行挂载,挂载可以理解为将硬盘、光驱设备与系统已有的目录进行关联 挂载是在使用硬件设备前所执行的最后一步操作。只需使用mount命令把硬盘设备或分区与一个目录文件进行关联,然后就能在这个目录 中看到硬件设备中的数据了。 mount命令用于挂
阅读全文
摘要:linux系统中每一个硬件也被视作文件,包括硬盘、光盘、鼠标等(linux系统中,一切皆是文件) 系统内核中的udev设备管理器会自动把硬件名称规范起来,目的是让用户通过设备文件的名称可以猜出设备大致的属性以及分区信息等。 linux系统中几乎所有的硬件设备都这/dev 目录下: 1、linux系统
阅读全文
摘要:linux系统中,一切文件都是从跟目录“/”开始,按照文件系统层次化标准(FHS)采用树形结构来存放文件,并规定了常见目录的用途。 在早期的 UNIX 系统中,各个厂家各自定义了自己的 UNIX 系统文件目录,比较混乱。Linux 面世不久后,对文件目录进行了标准化,于1994年对根文件目录做了统一
阅读全文
摘要:1、在linux系统中一切皆是文件 除了常见的文件比如文本文件、图形文件、程序文件外;设备文件像鼠标、键盘;网络文件(socket)等都抽象为文件。 普通文件:存放数据、程序等信息的文件。 目录文件:指的文件目录。 链接文件:包含软链接文件和硬链接文件。 设备文件:包含块设备文件(硬盘、软盘、光盘等
阅读全文
摘要:1、linux系统中sudo服务是的普通用户能够执行较大权限的命令 使用sudo -l 命令 查看是否具有sudo权限: [root@linuxprobe test]# ls [root@linuxprobe test]# whoami root [root@linuxprobe test]# su
阅读全文
摘要:1、linux系统中su 和 su - 都是用于登录用于切换的命令 su:切换用户,环境变量不变,路径不变 su - : 切换用户,环境变量随切换用户发生改变,回到家目录 测试 su 命令: [root@linuxprobe test]# ls [root@linuxprobe test]# who
阅读全文
摘要:1、linux系统中普通权限的设置主要是针对一类情形,比如针对所有者、所属组或者其他人的设置。 linux系统中的文件访问控制列表是针对特定具体的用户或者用户组来进行权限设置。 直接测试: ## 为了对比,先测试未分配ACL之前的情况[root@linuxprobe test]# ls [root@
阅读全文
摘要:linux系统中文件除了具备一般权限和特殊权限外,还有一种隐藏权限,即被隐藏起来的权限 chattr命令用于增减文件和目录的隐藏权限 1、 chattr -i 选项 不能删除文件、不能对文件进行修改 [root@linuxprobe home]# whoami root [root@linuxpro
阅读全文
摘要:1、linux中SBIT权限用于对目录进行设定 使只有文件或者目录的所有者才能删除文件或者目录 测试不加 SBIT权限的情况: [root@linuxprobe home]# mkdir test01 test02 [root@linuxprobe home]# chmod 777 test01 #
阅读全文
摘要:linux系统中chgrp命令用户改变文件或者目录的所属组 chgrp 为 change group的缩写 用法: chgrp 【选项】 文件/目录 1、创建测试文件 [root@linuxprobe test]# ls [root@linuxprobe test]# whoami root [ro
阅读全文
摘要:1、创建测试文件 [root@linuxprobe test]# whoami root [root@linuxprobe test]# touch a.txt b.txt ## 测试文件 [root@linuxprobe test]# su - liujiaxin01 ## 切换至普通用户 [li
阅读全文
摘要:1、linux系统中文件和目录的权限 按照用户可分为所有者、所属组和其他人。 所有者用u代表(user) 所属组用g代表(group) 其他人用o代表(other) 按照具体的权限可以分为可读、可写、可执行、无权限 可读用r代表(read),用数字4表示 可写用w代表(write),用数字2表示 可
阅读全文
摘要:1、创建测试用户 [root@linuxprobe home]# for i in liujiaxin{01..05};do useradd -g root $i;echo "123456" | passwd --stdin $i;done##创建测试用户,指定所属组为root,密码为123456
阅读全文
摘要:1、使用conda创建环境遇到如下问题: 2、备份原来的配置文件 mv .condarc .condarc.backup 3、创建新的配置文件 vim .condarc ##输入: channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/p
阅读全文
摘要:1、linux系统中一共有七种文件类型,参考:https://www.cnblogs.com/songgj/p/8890710.html linux一共有7种文件类型,分别如下: -:普通文件 d:目录文件 l: 软链接(类似Windows的快捷方式) (下面四种是特殊文件) b:块设备文件(例如硬
阅读全文
摘要:1、使用usermod -L 选项限制用户登录 [root@linuxprobe home]# usermod -L linuxprobe ##禁止用户linuxprobe登录 [root@linuxprobe home]# passwd -S linuxprobe ## 查看状态,锁定状态 lin
阅读全文
摘要:1、linux系统中usermod命令用于修改已创建用户的信息 用法:usermod [选项] username [root@linuxprobe home]# tail -n 3 /etc/group tcpdump:x:72: linuxprobe:x:1000: apache:x:48: [r
阅读全文
摘要:1、linux中groupadd命令用于创建新的用户组 直接测试,创建用户组: [root@linuxprobe home]# tail -n 3 /etc/group ## 查看用户组信息后三行 tcpdump:x:72: linuxprobe:x:1000: apache:x:48: [root
阅读全文
摘要:1、linux系统中useradd命令用于创建新的用户 使用方法 useradd name [root@linuxprobe home]# ls linuxprobe software [root@linuxprobe home]# pwd ##路径 /home [root@linuxprobe h
阅读全文
摘要:1、crontab命令用于创建系统能够周期性、有规律地执行某些具体的任务 直接测试:crontab -e 进行创建、编辑任务 [root@linuxprobe test]# ls ## 查看测试文件 a.txt [root@linuxprobe test]# ll -h total 6.6M -rw
阅读全文
摘要:1、一次性计划任务服务顾名思义只执行一次,直接测试 [root@linuxprobe test]# date ## 查看系统当前日期 Mon Oct 19 12:45:10 CST 2020 [root@linuxprobe test]# at 12:48 ## 使用格式, at + 时间,表示在1
阅读全文
摘要:1、case命令选择执行 [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test.sh ## 查看脚本 #!/bin/bash echo "This is a test!" echo "you can choose 0-
阅读全文
摘要:1、 [root@linuxprobe test]# ls ## 测试数据 a.txt [root@linuxprobe test]# cat a.txt fd gfd fgd fsdafds dfs sff [root@linuxprobe test]# cat -A a.txt ^I^Ifd g
阅读全文
摘要:1、测试数据 [root@linuxprobe test]# ls ## 测试数据 a.txt [root@linuxprobe test]# cat a.txt fd gfd fgd fsdafds dfs sfa [root@linuxprobe test]# cat -A a.txt fd g
阅读全文
摘要:1、linux系统中find命令主要用于查找文件,可以设置不同的查找条件进行查找 创建测试数据: [root@linuxprobe test]# touch a.txt b.txt c.txt ## 创建三个普通文件 [root@linuxprobe test]# mkdir test1 test2
阅读全文
摘要:1、linux系统中字符串比较语句用来判断字符串是否相等、或者字符串的代表的变量是否被赋值过 = 表示字符串是否相同 [root@linuxprobe test]# a=xxx [root@linuxprobe test]# [ $a = "xxx" ] [root@linuxprobe test]
阅读全文
摘要:1、-eq 表示等于 [root@linuxprobe test]# [ 3 -eq 4 ] [root@linuxprobe test]# echo $? 1 [root@linuxprobe test]# [ 3 -eq 3 ] [root@linuxprobe test]# echo $? 0
阅读全文
摘要:1、查看系统、java安装情况 [root@linuxprobe ~]# cat /etc/system-release Red Hat Enterprise Linux release 8.0 (Ootpa) [root@linuxprobe ~]# java bash: java: comman
阅读全文
摘要:1、查看系统版本及当前java环境 [root@linuxprobe home]# cat /etc/system-release ## 查看系统版本 Red Hat Enterprise Linux release 8.0 (Ootpa) [root@linuxprobe home]# java
阅读全文
摘要:1、系统版本、java环境查看 [root@linuxprobe home]# cat /etc/system-release ## 查看系统版本 Red Hat Enterprise Linux release 8.0 (Ootpa) [root@linuxprobe home]# java ##
阅读全文
摘要:1、测试数据 [root@linuxprobe test]# ls outcome.map outcome.ped [root@linuxprobe test]# cat outcome.ped DOR 1 0 0 0 -9 C C C C A A G G A G G G G G G C DOR 2
阅读全文
摘要:1、linux系统中case主要用于选择执行、在需要进行多重分支的情况下使用,case在多个范围内匹配数据,若匹配成则执行相关的命令并结束整个条件测试。 简单示例: [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test
阅读全文
摘要:1、 直接创建用户 [root@linuxprobe home]# pwd/home [root@linuxprobe home]# ls a.txt linuxprobe software test.sh [root@linuxprobe home]# seq -f liujiaxin%02g 1
阅读全文
摘要:1、&& 表示与,上一句执行成功则执行下一句;|| 表示或,上一句执行失败则执行下一句 [root@linuxprobe test]# touch a.txt [root@linuxprobe test]# ls a.txt [root@linuxprobe test]# [ -e a.txt ]
阅读全文
摘要:1、Linux系统中文件测试语句用于判断文件是否存在、是文件或者目录、或者权限判断 linux系统中 echo $? 用于判断上一句是否成功执行,成功返回0,不成功返回其他数字, 简单示例: [root@linuxprobe test]# ls [root@linuxprobe test]# mkd
阅读全文
摘要:1、linux系统中while循环示例 [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test.sh #!/bin/bash echo "the scale of price is 0-999!" ## 输入内容提示 P
阅读全文
摘要:1、linux中$random用于生成0—32767的随机数 简单示例: [root@linuxprobe r_toy_par]# echo $RANDOM ## 取随机值 (小概率一样) 23603 [root@linuxprobe r_toy_par]# echo $RANDOM ##同上 16
阅读全文
摘要:1、linux系统中let命令在bash中用于计算,变量名前不用加$,可以实现自加和自减操作 简单用法 [root@linuxprobe test]# a=3 [root@linuxprobe test]# echo $a 3 [root@linuxprobe test]# b=a+4 [root@
阅读全文
摘要:1、linux系统中expr命令实现命令行中的四则运算 简单示例: [root@linuxprobe test]# expr 5 + 3 ## 在命令行中实现加法运算 8 2、中间必须有空格 [root@linuxprobe test]# expr 5+3 ##中间必须有空格 5+3 [root@l
阅读全文
摘要:1、linux系统中read命令用于从标准输入中读取数据,进而给变量赋值。 简单用法: [root@linuxprobe test]# echo $var1 ## 首先查看未赋值前变量,发现是空值 [root@linuxprobe test]# read var1 ## read命令直接跟想要赋值的
阅读全文
摘要:1、id命令用于反馈用于ID,所属组ID,(所属组名 ?) 使用root测试结果: [root@linuxprobe home]# whoami ## root用户 root [root@linuxprobe home]# echo $USER root [root@linuxprobe home]
阅读全文
摘要:1、基本结构 #!/bin/bash ## 声明脚本解释器 for 变量 in 可迭代对象 do 循环体 done 2、简单实例 [root@linuxprobe test3]# for i in 1 10 100 500;do echo $i;done ## 可以直接在命令行中使用,变量前需加 $
阅读全文
摘要:1、准备测试数据 [root@linuxprobe test3]# cat test.map 1 snp1 0 55910 1 snp2 0 85204 1 snp3 0 122948 1 snp4 0 203750 1 snp5 0 312707 1 snp6 0 356863 1 snp7 0
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test3]# cat a.txt e i j s e f Y U D S D G 2、小写转换为大写 tr [root@linuxprobe test3]# tr [a-z] [A-Z] < a.txt ## 所有小写字符转换为大写 E I J
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test3]# cat a.txt wrwrt fdgsaf fsads gdfgde fsddd dffgdf sfdef sdfdsg 2、 [root@linuxprobe test3]# sed 's/.//' a.txt ##删除开头一个
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test3]# cat a.txt w r t f s 4 6 6 a g g s d g r 4 d e w h s f g h 2、 [root@linuxprobe test3]# grep -E '^w|^a|h$' a.txt ## 提取
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test3]# echo {1..300} | xargs -n 15 > a.txt [root@linuxprobe test3]# cat a.txt 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
阅读全文
摘要:1、运行python程序遇到下面问题,python版本3.6.8 ModuleNotFoundError: No module named 'scipy' 2、 pip3 install scipy
阅读全文
摘要:1、运行python程序,遇到下面报错,python版本3.6.8 import numpy as np ModuleNotFoundError: No module named 'numpy' 2、执行如下命令 pip3 install numpy
阅读全文
摘要:1、测试数据 [root@linuxprobe test]# ls test.map test.ped [root@linuxprobe test]# cat test.map ## 测试数据snpID为. 1 . 0 55910 1 . 0 85204 1 . 0 122948 1 . 0 203
阅读全文
摘要:1、准备测试数据,8个样本,8个位点 [root@linuxprobe test]# cat outcome.ped DOR 1 0 0 0 -9 A G G G G G G C G G C C C C 0 0 DOR 2 0 0 0 -9 G G G G A G C C G G G C C C 0
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# cat a.txt ## 随机创建测试数据 fr dfg rte er hdf fgh dg fgd rtw er ewr scf yt ret tgr 2、简单用法 [root@linuxprobe test]# awk '$1 ~
阅读全文
摘要:1、准备测试数据10个样本,10个位点 [root@linuxprobe test]# ls test.map test.ped [root@linuxprobe test]# cat test.ped ## 10个样本,10行 DOR sample01 0 0 0 -9 G G C C G G G
阅读全文
摘要:1、R语言seq函数用于生成一段步长相等的序列 简单用法: > seq(5) ##默认从1开始,默认步长为1,只跟一个数字默认是终点 [1] 1 2 3 4 5 > seq(6) [1] 1 2 3 4 5 6 > seq(5.6) [1] 1 2 3 4 5 2、设定起点 > seq(5) [1]
阅读全文
摘要:1、创建测试数据 利用awk进行合并(1) [root@linuxprobe test2]# seq -w 30 | xargs -n 2 | sed = | sed 'N;s/\n/> /' > a.txt ##创建测试数据 [root@linuxprobe test2]# cat a.txt 1
阅读全文
摘要:1、利用xargs命令将多列数据转化为一列数据 [root@linuxprobe test2]# echo "1 2 3 4 5 6" > a.txt [root@linuxprobe test2]# cat a.txt 1 2 3 4 5 6 [root@linuxprobe test2]# ca
阅读全文
摘要:1、利用xargs进行行列转换 [root@linuxprobe test2]# seq 512345[root@linuxprobe test2]# seq 5 | xargs ## xargs 默认转化为1行1 2 3 4 5[root@linuxprobe test2]# seq 5000 |
阅读全文
摘要:1、R语言中sort函数对向量按照从小到大排序,默认返回向量从小到大的值 创建测试数据: > test <- c(7,1,9,3,8)> test[1] 7 1 9 3 8> a <- sort(test) ## 默认升序> class(a) ## 返回值为数值[1] "numeric"> a[1]
阅读全文
摘要:1、基本用法,直接运行date 显示系统当前时间 [root@linuxprobe test]# date Mon Oct 5 20:03:00 CST 2020 2、以特定格式输出,如“年-月-日 时:分:秒” [root@linuxprobe test]# date "+%Y-%m-%d %H:
阅读全文
摘要:1、准备测试数据 [root@linuxprobe test]# ls test.map test.ped [root@linuxprobe test]# wc -l * ## 46827个位点,60个样本 46827 test.map 60 test.ped 46887 total [root@l
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# echo "aaa.bbb.ccc.ddd" > a.txt [root@linuxprobe test]# cat a.txt aaa.bbb.ccc.ddd 2、利用\进行转义,使转义字符仍为字符串 [root@linuxprob
阅读全文
摘要:1、简单用法,直接加数字 [root@linuxprobe test]# seq 10 ## 输出1到10列表 1 2 3 4 5 6 7 8 9 10 2、设置起点、终点 [root@linuxprobe test]# seq 5 10 ##设置起点为5,终点为10,默认的步长为1。 5 6 7
阅读全文
摘要:1、*比较常用的通配符,表示匹配任意长度的任意字符 创建测试数据: [root@linuxprobe test]# touch {1..3}.txt {1..3}.csv {1..3}.xxx ## 利用touch常见空文件 [root@linuxprobe test]# ls 1.csv 1.tx
阅读全文
摘要:1、创建测试数据 > test <- c(1,2,3,1,1,2,5) ##创建向量测试数据> test[1] 1 2 3 1 1 2 5> duplicated(test) ## 基本用法,返回逻辑值,非重复为F,重复为T[1] FALSE FALSE FALSE TRUE TRUE TRUE F
阅读全文
摘要:1、标准输入重定向0,通常省略;标准输出重定向1,通常省略;标准错误输出重定向2,不能省略 创建测试数据 [root@linuxprobe test]# echo 'this is a test!' > a.txt[root@linuxprobe test]# lsa.txt[root@linuxp
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# cat a.txt e i j s e f s d g e d d 2、利用grep命令统计字符e出现的次数 [root@linuxprobe test]# grep -o "e" a.txt | wc -l 3 3、同时统计e和d出
阅读全文
摘要:1、使用vim编辑器创建测试数据 [root@linuxprobe test]# cat a.txt ewetrte fsdfgf dfghghj dsffgd hgfdwe 2、统计每一行f出现的次数 [root@linuxprobe test]# awk -F "f" '{print NF-1}
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=40000 of=c.txt [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=4000 of=d.txt [roo
阅读全文
摘要:1、R语言strsplit用于分割字符串 创建测试数据 > test <- "aa bb cc dd ee ff" ##创建测试数据 > test [1] "aa bb cc dd ee ff" > class(test) ## 测试数据为字符 [1] "character" 2、按照指定分隔符拆分
阅读全文
摘要:1、使用vim创建测试数据 a.txt [root@linuxprobe test]# cat a.txt 1 w e t 2 s f h 3 z c g 4 e a g 5 a f w 6 k h d 7 w f r 2、删除指定的行 [root@linuxprobe test]# sed '3d
阅读全文
摘要:1、创建测试数据 > test <- as.data.frame(matrix(1:100,nrow = 10)) > test V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 1 1 11 21 31 41 51 61 71 81 91 2 2 12 22 32 42 52 62 7
阅读全文
摘要:1、创建测试数据 > dat <- as.data.frame(matrix(1:100,nrow =10)) > dat V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 1 1 11 21 31 41 51 61 71 81 91 2 2 12 22 32 42 52 62 72 8
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# seq 20 > a.txt [root@linuxprobe test]# ls a.txt [root@linuxprobe test]# head a.txt 1 2 3 4 5 6 7 8 9 10 2、提取奇数行 [root
阅读全文
摘要:1、创建测试数据 [root@linuxprobe test]# seq 30 > a.txt [root@linuxprobe test]# ls a.txt [root@linuxprobe test]# head a.txt 1 2 3 4 5 6 7 8 9 10 2、提取奇数行 [root
阅读全文
摘要:1、遇到一个数据需要提取奇数列 创建测试数据 [root@linuxprobe test]# seq -f %03g 60 | xargs -n 30 > test.txt[root@linuxprobe test]# seq -f c%02g 30 | xargs |cat - test.txt
阅读全文
摘要:1、遇到一个数据需要提取奇数列 [root@linuxprobe test]# cat test.txtc1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27
阅读全文
摘要:1、运行perl程序遇到如下报错,Can't exec "epstopdf": No such file or directory 2、 安装 epstopdf git clone https://github.com/lgong30/epstopdf.g cd epstopdf/ chmod +x
阅读全文
摘要:1、sh: gnuplot: command not found 2、 安装 yum install gnuplot
阅读全文