Posts

Showing posts with the label Linux

Shell command-line tools

General purpose command-line tools basename Extract just the filename from a filepath bc A calculator that reads from standard input cat Concatenates files together cd Change directory cp Copy files csvfix Parse CSV files curl Transfer a URL cut Cut out selected portions of lines date Print or parse date strings echo Print arguments to standard output grep Print lines matching a pattern head Print only the first few lines of a text stream history Show the last executed commands hostname Print the name of the computer you're currently on iconv Converts between character sets jq A command-line JSON parser kill Send a signal to a running process less Paginate long text streams ls List directory contents man Show documentation for a command mkdir Make a directory mv Move or rename files nano Interactive text editor printf Format and print data ps Show a snapshot of current processes pup Parse HTML from the ...

Ubuntu17.04下 配置 aria2

第一章节  安装并配置 #  安装aria2 sudo apt-get install aria2 #  安装完配置aria2 sudo mkdir /etc/aria2     sudo touch /etc/aria2/aria2.session      sudo chmod 777 /etc/aria2/aria2.session    #权限设置aria2.session可读写执行 # 将自定义配置信息写入配置文件 /etc/aria2/aria2.conf  sudo bash -c 'cat <<EOT > /etc/aria2/aria2.conf dir=${HOME}/Downloads   #  ==文件保存目录自行修改,请使用绝对路径 disable-ipv6=true  enable-rpc=true   #  打开rpc的目的是为了给web管理端用 rpc-allow-origin-all=true rpc-listen-all=true #rpc-listen-port=6800 continue=true input-file=/etc/aria2/aria2.session save-session=/etc/aria2/aria2.session max-concurrent-downloads=10 EOT' # 启动aria2,测试是否运行成功,无错误 # sudo aria2c --conf-path=/etc/aria2/aria2.conf #  如果没有提示错误,按ctrl+c停止运行命令,转为后台运行: sudo aria2c --conf-path=/etc/aria2/aria2.conf -D # 把aria2做成服务启动 sudo -u ${HOME##*\/} bash -c 'cat <<EOT >  /etc/init.d/aria2c #!/bin/sh ### BEGIN INIT INFO ...