1、hexdump

  命令简介:hexdump是Linux下的一个二进制文件查看工具,它可以将二进制文件转换为ASCII、八进制、十进制、十六进制格式进行查看。

  命令语法:hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]

  命令参数:此命令参数是Red Hat Enterprise Linux Server release 5.7下hexdump命令参数,不同版本Linux的hexdump命令参数有可能不同。

  

  学习参考:https://www.cnblogs.com/kerrycode/p/5077687.html

2、ag

  安装:sudo apt-get install silversearcher-ag

  命令简介:在文件里搜索特定的文本

  命令语法:ag [options] PATTERN [PATH]

  命令参数:man ag

  学习参考:https://www.cnblogs.com/GMCisMarkdownCraftsman/p/3795315.html

参考:http://man.linuxde.net/

  http://www.cnblogs.com/peida/archive/2012/12/05/2803591.html

3、scp

  命令简介:linux 的 scp 命令 可以 在 linux 之间复制 文件 和 目录;

  命令格式: scp [可选参数] file_source file_target

  命令参数:man scp

  从 本地 复制到 远程 

    复制文件:scp local_file remote_username@remote_ip:remote_file

      scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music

    复制目录:scp -r local_folder remote_username@remote_ip:remote_folder 

      scp -r /home/space/music/ root@www.cumt.edu.cn:/home/root/others/

  从 远程 复制到 本地

    从 远程 复制到 本地,只要将 从 本地 复制到 远程 的命令 的 后2个参数 调换顺序 即可;

    scp root@www.cumt.edu.cn:/home/root/others/music /home/space/music/1.mp3 
          scp -r www.cumt.edu.cn:/home/root/others/ /home/space/music/

  

#!/bin/bash

ty=$
local_dir=$
remote_ip=$
remote_dir=$ showUsage() {
echo -e "\033[31m ty local_dir remote_ip remote_dir \033[0m"
echo -e "\033[32m ty = l(local to remote); ty = r(remote to local) \033[0m"
echo -e "\033[32m local_dir = local file or local dir \033[0m"
echo -e "\033[32m remote_dir = remote file or remote dir \033[0m"
} #Copy the local file to the remote server
l_to_r() {
expect -c "
spawn scp -r ${local_dir} root@${remote_ip}:${remote_dir}
expect {
\"*password\" {set timeout 300; send \"passwd\r\";}
#设置超时时间,和输入passwd
} expect eof"
} #Copy the remote file to the local server
r_to_l() {
expect -c "
spawn scp -r root@${remote_ip}:${remote_dir} ${local_dir}
expect {
\"*password\" {set timeout 300; send \"passwd\r\";}
} expect eof"
} case $ in
"l")
l_to_r
;;
"r")
r_to_l
;;
*)
showUsage
;;
esac

      学习参考:https://www.cnblogs.com/hitwtx/archive/2011/11/16/2251254.html

4、tee

  Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。

  tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。

  语法:tee [-ai][--help][--version][文件...]

  参数:a或--append  附加到既有文件的后面,而非覆盖它;-i或--ignore-interrupts  忽略中断信号;

  eg:ls | tee ./test.txt

5、iperf

  命令简介:iperf命令是一个网络性能测试工具。iperf可以测试TCP和UDP带宽质量。iperf可以测量最大TCP带宽,具有多种参数和UDP特性。iperf可以报告带 宽,延迟抖动和数据包丢失。利用iperf这一特性,可以用来测试一些网络设备如路由器,防火墙,交换机等的性能。

  用法:

    device:

      iperf -s

    pc:

      iperf -c deviceIp -t 120 -i 10

   参考:http://blog.csdn.net/hankerzero/article/details/55093915

6、export

Linux设置/删除环境变量方法:
bash下
设置:export 变量名=变量值
删除:unset 变量名

7、date

8、sort

9、head

10、tail

11、expect

expect是用于提供自动交互的工具

不同系统安装方法不一样

ubuntu:sudo apt-get install expect

#!/usr/bin/expect
#set timeout 20 #设置超时时间
spawn ssh root@192.168.43.131
expect "*password:"
send "123\r"
# expect "*#"
interact

 1、#!/usr/bin/expect :需要先安装软件,然后来说明用expect来执行

  2、spawn ssh root@192.168.43.131 :spawn是进入expect环境后才可以执行的expect内部命令,用来执行它后面的命令。

  3、expect "*password:" :也是expect的内部命令,用来解惑关键的字符串,如果有,就会立即返回下面设置的内容,如果没有就看是否设置了超时时间。

4、send "123\r":这时执行交互式动作,与手工输入密码等效,在expect截获关键字之后,它就会输入send后面的内容。

5、interact :执行完毕后把持交互状态,把控制台,这时候就可以进行你想要进行的操作了。如果没有这一句,在登陆完成之后就会退出,而不是留在远程终端上。

摘抄自:https://www.cnblogs.com/yangmingxianshen/p/7967040.html

12、dd

dd if=/dev/urandom of=rnd_data bs=1024 count=32768000
sudo dd if=rnd_data of=/dev/sdc bs=1024 count=32768000
sudo dd if=/dev/sdc of=rnd_read bs=1024 count=32768000

注:随机产生非0的数据,保存到文件rnd_data,每次1k,共32G

参考:https://www.cnblogs.com/jikexianfeng/p/6103500.html

https://blog.csdn.net/cupidove/article/details/41379047  

13、sed

  去除文件中单引号

  sed -e $'s/\'//g' ./FileName

14、ldd

ldd本身不是一个程序,而仅是一个shell脚本:ldd可以列出一个程序所需要得动态链接库 

格式:ldd [options] file   

功能:列出file运行所需的共享库

参数:

-d    执行重定位并报告所有丢失的函数

-r    执行对函数和对象的重定位并报告丢失的任何函数或对象

示例:

xiaomanon@xiaomanon-machine:~/Documents/c_code$ ldd tooltest
linux-gate.so.1 => (0xb775b000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7595000)
/lib/ld-linux.so.2 (0xb775c000)

我们可以将ldd的输出结果分为3列来看:

■ 第一列:程序需要依赖什么库

■ 第二列:系统提供的与程序需要的库对应的库名称

■ 第三列:依赖库加载的开始地址

通过上面的这些信息,我们可以总结出下面的用途:

(1) 通过对比第一列和第二列,我们可以知道程序需要的动态链接库和系统实际提供的是否相比配。

(2) 通过第三列,我们可以知道当前动态链接库中的符号在进程地址空间中的起始位置。

15、nm

就是可以帮你列举出该目标中定义的符合要求的符号。要求可以很多,主要通过参数实现:外部引入的、内部定义的、动态的... 也可以添加参数使nm同时打印行号、文件名等相关信息

格式:nm [options] file

功能:列出file中的所有符号

参数:

-C   将符号转化为用户级的名字

-s   当用于.a文件即静态库时,输出把符号名映射到定义该符号的模块或成员名的索引

-u   显示在file外定义的符号或没有定义的符号

-l   显示每个符号的行号,或为定义符号的重定义项

linux 命令学习参考:http://www.runoob.com/linux/linux-comm-tee.html

linux 命令使用方法(随时更新)的更多相关文章

  1. linux 命令小结(随时更新)

    代码备份命令: tar cvf 备份文件名 要备份的目录名 查看Linux服务器内存使用情况: 1.free命令 free -m [root@localhost ~]# free -m        ...

  2. 排查问题所用到的一些Linux命令实践(不定期更新。。)

    一.前言 线上问题排查可能是每个程序员都会经历的.在排查的过程中,往往会用到很多Linux命令,也会产生一些很实用的技巧.本博文通过分析一次线上问题排查的过程,把所有用到的命令串起来.每个Linux命 ...

  3. 个人linux简单笔记,随时更新

    vim显示行数 :set nu 查找文件 find /home -name config.txt 重命名文件或者文件夹 mv a b centos中phpize的安装 yum install php- ...

  4. 路由器终端常用linux命令汇总(持续更新)

    ls:显示文件名与相关属性 ls -al;ls -l;ls -a 第一列: d:表示目录,dir. -:表示文件. l:表示链接文件,linkfile. 接下来的字符三个为一组,且均为rwx这3个字母 ...

  5. 计算机操作系统学习(一) Linux常用指令(随时更新)

    1.chmod 以下转载至https://blog.csdn.net/summer_sy/article/details/70142475 chmod u+x file.sh 就表示对当前目录下的fi ...

  6. 总结工作中常见的linux命令

    本文是总结下自己在工作中遇到的常见linux 命令,会持续更新! 1.文件路径切换 进入 cd 返回上一级  cd .. 2.复制 cp 源文件名 目标文件夹 cp log.log test5 3.编 ...

  7. Linux核心命令使用方法

    一.Linux命令行常用快捷键 ctrl + c cancel 取消当前的操作 ctrl + l (小写字母L) clear(命令)清空当前屏幕 ctrl + d 退出当前用户 ctrl + r 查找 ...

  8. linux常用命令使用方法

    一.常用的分析服务器日志命令 1.查看有多少个IP访问: awk '{print $1}' log_file|sort|uniq|wc -l 2.查看某一个页面被访问的次数: grep "/ ...

  9. Linux命令 ls 和 ll 的使用方法与基本区别

    Linux 命令 ls 和 ll 的使用方法: ll:罗列出当前文件或目录的详细信息,含有时间.读写权限.大小.时间等信息 ,像Windows显示的详细信息.ll是“ls -l"的别名.相当 ...

随机推荐

  1. 解决gitHub下载速度慢的问题

    转载:http://blog.csdn.net/x_studying/article/details/72588324 github被某个CDN被伟大的墙屏蔽所致. 解决方法: 1.访问http:// ...

  2. RocketMQ安装教程

    1.下载 http://mirror.bit.edu.cn/apache/rocketmq/ 2.安装 .tar.gz cd alibaba-rocketmq/bin chmod u+x * 3.配置 ...

  3. Spring Cloud之路:(七)SpringBoot+Shiro实现登录认证和权限管理

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/sage_wang/article/details/79592269一.Shiro介绍1.Shiro是 ...

  4. PHP -S命令 PHP内置web服务器

    手册详细介绍 : http://www.php.net/manual/zh/features.commandline.webserver.php 适合本地开发  php 5.4.0起 这个内置的Web ...

  5. MFC CDHtmlDialog 加载本地资源

    步骤:1.资源视图 项目右击选择资源添加,自定义添加新类型 如:JS(会增加JS文件夹)2. 选择1新建的文件夹右击 添加资源 导入 选择js文件引入3. 在资源文件Resource.h文件夹能找到资 ...

  6. anglar cli的 rxjs_1.of is not a function

    按照官网敲例子遇到 rxjs_1.of is not a function import { Observable,of } from 'rxjs'; 改为 import { Observable} ...

  7. 4.3 if-else语句使用

    Q:对输入的成绩进行登记划分. #include<iostream> #include<cstdio> using namespace std; int main() { in ...

  8. unity中导入插件时报错处理办法

    错误如下: Unhandled Exception: System.TypeLoadException: Could not load type 'System.ComponentModel.Init ...

  9. git-github-TortoiseGit综合使用教程(一)简介

    简介: 本系列教程将参考廖雪峰的git系列教程,使用github的web界面,和TortoiseGit图形界面windows程序来实现. git 是什么: Git是目前世界上最先进的分布式版本控制系统 ...

  10. 二叉排序树,Binary_Sort_Tree,C++完整实现

    body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...