软件安装

sudo apt-get install xxx

压缩和解压缩

1. *.tar 用 tar –xvf 解压

2. *.gz 用 gzip -d或者gunzip 解压

3. *.tar.gz和*.tgz 用 tar –xzf 解压

4. *.bz2 用 bzip2 -d或者用bunzip2 解压

5. *.tar.bz2用tar –xjf 解压

6. *.Z 用 uncompress 解压

7. *.tar.Z 用tar –xZf 解压

8. *.rar 用 unrar e解压

9. *.zip 用 unzip 解压

scp命令文件传输

scp [可选参数] file_source file_target

从 本地 复制到 远程

scp local_file remote_username@remote_ip:remote_folder

或者

scp local_file remote_username@remote_ip:remote_file

或者

scp local_file remote_ip:remote_folder

或者

scp local_file remote_ip:remote_file

第1,2个指定了用户名,命令执行后需要再输入密码,第1个仅指定了远程的目录,文件名字不变,第2个指定了文件名;

第3,4个没有指定用户名,命令执行后需要输入用户名和密码,第3个仅指定了远程的目录,文件名字不变,第4个指定了文件名;

复制目录

scp -r local_folder remote_username@remote_ip:remote_folder

或者

scp -r local_folder remote_ip:remote_folder

从 远程 复制到 本地同理

可能有用的几个参数 :

-v 和大多数 linux 命令中的 -v 意思一样 , 用来显示进度 . 可以用来查看连接 , 认证 , 或是配置错误 .

-C 使能压缩选项 .

-P 选择端口 . 注意 -p 已经被 rcp 使用 .

-4 强行使用 IPV4 地址 .

-6 强行使用 IPV6 地址 .

(参考详细解析Linux scp命令的应用

无密码登陆

两步操作搞定

1.本地主机创建公钥和密钥

ssh-key-gen 一路回车

2.复制公钥到远程主机

ssh-copy-id -i ~/.ssh/id_rsa.pub  username@ip

接下来可以验证了:ssh username@ip

screen

新建screen:screen -S name

在screen中再开个窗口:ctrl+a+c

跳到下一个screen窗口:ctrl+a+n

跳到上一个screen窗口:ctrl+a+p

退出窗口:ctrl+a+d

查看某个screen:screen -r name

使用screen的时候出现了如下错误:

Cannot open your terminal '/dev/pts/11' - please check.

可以使用script命令来记录这个终端会话,执行

script /dev/null

然后就可以打开screen了

列举screen:screen -ls

清除已经死掉的screen: scren -wipe

可以参考的一个链接:http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html

linux定时任务

OPTIONS
-u It specifies the name of the user whose crontab is to be tweaked. If this option is not given, crontab examines "your"
crontab, i.e., the crontab of the person executing the command. Note that su(8) can confuse crontab and that if you
are running inside of su(8) you should always use the -u option for safety’s sake. The first form of this command is
used to install a new crontab from some named file or standard input if the pseudo-filename "-" is given.

-l The current crontab will be displayed on standard output.

-r The current crontab will be be removed.

-e This option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment vari-
ables. After you exit from the editor, the modified crontab will be installed automatically.

-i This option modifies the -r option to prompt the user for a ’y/Y’ response before actually removing the crontab.

-s It will append the current SELinux security context string as an MLS_LEVEL setting to the crontab file before editing /
replacement occurs - see the documentation of MLS_LEVEL in crontab(5).

如果为当前用户创建cron服务,则可以:

键入 crontab  -e 编辑crontab服务文件

35 12 * * * /usr/bin/python /home/jun/dou.py >/tmp/runs.log 2>&1

保存并退出。

  cron文件语法:

分      小时      日       月       星期     命令

0-59   0-23   1-31   1-12     0-6     command     (取值范围,0表示周日,一般一行对应一个任务)

记住几个特殊符号的含义:

“*”       代表取值范围内的数字,
         “/”       代表”每”,
         “-”       代表从某个数字到某个数字,
         “,”       分开几个离散的数字

在这些字段里,除了“Command”是每次都必须指定的字段以外,其它字段皆为可选字段,可视需要决定。对于不指定的字段,要用“*”来填补其位置。

举例如下:

  5  *  *  *  *    ls 指定每小时的第5分钟执行一次ls命令
  */5  *  *  *  *    ls 指定每隔5分钟执行一次ls命令
  30  5  *  *  *    ls 指定每天的 5:30 执行ls命令
  30  7  8  *  *    ls 指定每月8号的7:30分执行ls命令
  30  5  8  6  *    ls 指定每年的6月8日5:30执行ls命令
  30  6  *  *  0    ls 指定每星期日的6:30执行ls命令[注:0表示星期天,1表示星期1

linux常用的一些命令行操作(ubuntu)的更多相关文章

  1. linux的基本的命令行操作

    linux的基本的命令行操作 第一步前登陆你的服务器 //创建文件夹的方法 mkdir 文件名 //进入指定文件夹 cd 文件名 //查看文件夹下的内容 ls or ll // 查看当前的路径 pwd ...

  2. LINUX常用操作命令和命令行编辑快捷键

    终端快捷键: Ctrl + a/Home 切换到命令行开始 Ctrl + e/End 切换到命令行末尾 Ctrl + l 清除屏幕内容,效果等同于clear Ctrl + u 清除剪切光标之前的内容 ...

  3. 在Linux下安装aws命令行操作

    使用安装包安装 环境: Linux, OS X, or Unix Python 2 version 2.6.5+ or Python 3 version 3.3+ 检查Python版本 $ pytho ...

  4. linux常用开发工具命令行

  5. linux快速入门 1.1命令行操作

    http://lovesoo.org/linux-command-line-operation.html 1.1命令行操作 目录: <wp_nokeywordlink>Shell简介 &l ...

  6. 【转帖】Linux命令行操作json神器jq

    Linux命令行操作json神器jq https://www.cnblogs.com/chenqionghe/p/11736942.html jq类似一个awk或grep一样的神器,可以方便地在命令行 ...

  7. HDFS分布式文件系统的常用命令行操作

    一.HDFS的客户端种类 1.网页形式  =>用于测试 网址为你的namenode节点的ip+50070的端口号,如: 192.168.50.128:50070 2.命令行形式 =>用于测 ...

  8. Kafka命令行操作及常用API

    一.Kafka命令行操作 1.查看当前集群已存在的主题 bin/kafka-topic.sh --zookeeper hd09-01:2181 --list 2.创建主题 bin/kafka-topi ...

  9. Ubuntu server版上使用命令行操作VPNclient

    Ubuntu server版上使用命令行操作VPNclient VPN,虚拟专用网络,这个技术还是非常有用的.近期笔者參与的项目中就使用上了VPN,大概情况是这种.有两个开发团队,在异地,代码服务器在 ...

随机推荐

  1. (一)Fiddler的介绍和安装

    一.Fiddler的介绍和安装 Fildder是一款免费的web调试代理工具,支持任何浏览器.系统或平台. 官网地址:https://www.telerik.com/fiddler Fiddler原理 ...

  2. 关于python urlopen 一个类似radio流的timeout方法

    终极解决方法来啦!看代码感受: import requests import eventlet import time eventlet.monkey_patch() try: with eventl ...

  3. "Could not find the main class: org.apache.catalina.startup.Boostrap. Program will exit."

    尝试将 myeclipse中的编译版本修改(如,将1.5修改为1.6)

  4. 这段时间使用MySQL的一些记录

    自从Fedora19之后,Linux上的MySQL就被MariaDB所取代,这段文字见如下引用: MySQL was replaced by MariaDB since Fedora 19 (http ...

  5. web 服务基础

    用户通过网站访问浏览器都发生了什么 如图,用户请求www.joker.com发生 1. 用户访问网站流程框架2. dns解析原理3. tcp/ip三次握手过程原理4. http协议原理(www服务的请 ...

  6. python学习 (三十一) python中的class

    1 python的类:   Python类都继承自object. __init__: 构造函数,如果不写,有一个默认的. __init__: 这个构造函数只能有一个,Python中不能有多个构造函数. ...

  7. 学生党如何拿到阿里技术offer: 《2016阿里巴巴校招内推offer之Java研发工程师(成功)》

    摘要: 这篇文章字字珠玑,这位面试的学长并非计算机相关专业,但是其技术功底足以使很多计算机专业的学生汗颜,这篇文章值得我们仔细品读,其逻辑条理清晰,问题把握透彻,语言表达精炼,为我们提供了宝贵的学习经 ...

  8. ubuntu下用expect实现密码自动输入

    每次笔记本一开机启动,总会连用不着且碍事的触摸板也一块启动.便想写个脚本,让电脑启动时关闭触摸板.(当然,我想更好的办法是,修改系统启动时的加载模块,让触摸板不自动加载,但是目前还不知道用这种方法怎么 ...

  9. SVN目录结构

    整理了一下svn目录结构,如下: 项目名称 ----branches    软件产品的迭代开发版本 ----tags        软件产品经过完整测试的历史稳定版本,已部署在客户机器上使用的 --- ...

  10. 2019 最新 阿里天猫、蚂蚁、钉钉ava 面试题汇总,附答案

    Java面试前需要做足各方面的准备工作,肯定都会浏览大量的面试题,本人也不例外,这是一些最新面试题,分享给大家. Java基础 面向对象的特征:继承.封装和多态 int 和 Integer 有什么区别 ...