learn shell,use linux,linux学习
linux shell 脚本攻略学习3
摘要:1.Bash中的READ命令#读取n个字符存入变量read -n number_of_chars variable_name示例:amosli@amosli-pc:~$ read -n 2 varheamosli@amosli-pc:~$ echo $varhe#不回显的方式读取密码read -s var示例:amosli@amosli-pc:~$ read -s varamosli@amosli-pc:~$ echo $varpw#显示提示信息read -p "Enter input:" var示例:amosli@amosli-pc:~$ read -p "En
阅读全文
posted @
2013-12-19 01:59
Hi_Amos
阅读(496)
推荐(0)
linux shell 脚本攻略学习2
摘要:1.关于文件描述符和重定向:文件描述符是与一个打开的文件或数据流相关联的整数。文件描述符0、1以及2是系统预留的.0——stdin(标准输入)1——stdout(标准输出)2——stderr(标准错误)使用“echo $?”来显示状态amosli@amosli-pc:~/learn$ echo $?2amosli@amosli-pc:~/learn$ ls + 2> out.txt //没有任何输出,因为已经重定向到out.txt里面了amosli@amosli-pc:~/learn$ cat out.txt ls: cannot access +: No such file or di
阅读全文
posted @
2013-12-19 00:36
Hi_Amos
阅读(1483)
推荐(0)
linux shell 脚本攻略学习1
摘要:1.关于echo和printf打印输出如果要使用转义序列,那么需要在echo 后面加上参数 -e来进行识别,下面例子是进行对比:amosli@amosli-pc:~/learn$ echo -e "1\t2\t3\t"1 2 3 amosli@amosli-pc:~/learn$ echo "1\t2\t\3\t"1\t2\t\3\t输出彩色输出:颜色码:重置为0,黑色为30,红色为31,绿色为32,黄色为33,蓝色为34,洋红为35,青色为36,白色为37.echo -e "\e[31m this is red text" //将终
阅读全文
posted @
2013-12-18 01:44
Hi_Amos
阅读(1052)
推荐(0)
linux vi 删除一行,复制一行命令,删除所有空白行
摘要:删除所有空白行(^是行的开始,\s*是零个或者多个空白字符;$是行尾):g/^\s*$/d删除一行:dd复制一行:yy ,之后是要 p 才会贴上来的.
阅读全文
posted @
2013-12-15 15:52
Hi_Amos
阅读(6314)
推荐(0)
Ubuntu 下用命令行快速打开html,mp3等文件
摘要:想用命令行打开网页文件,实现方法如下:1.Ctrl+Alt+T可以打开shell,F11可以全屏显示,输入以下命令即可打开js17.html,并且指定浏览器,比如指定chrome,google-chrome js17.html 类似用firefox打开,可用命令如下:firefox js17.html2.xdg-openxdg-open js17.htmlxdg-open格式:xdg-open { file | URL }xdg-open { --help | --manual | --version }可以使用xdg-open可以打开各种类型的文件,但都只是用默认程序打开,上面打开js17.
阅读全文
posted @
2013-12-12 00:29
Hi_Amos
阅读(780)
推荐(0)
ubuntu 连接windows远程桌面 &&rdesktop 退出全屏模式
摘要:参考:http://www.asgone.net/ubuntu-connect-windows-remote-desktop/呵呵,使用上了ubuntu,怎么接连上我的服务器的远程桌面呢,找了找帮助,使用终端命令就可以了:sudo apt-get install rdesktoprdesktop 124.42.120.174:1433呵呵,连接成功了。-f 全屏-a 16位色默认端口是3389(linux 22 sh)注意:windows 的服务中的 Terminal Servies 需要开启。我的电脑 右键 属性 远程中,勾选 允许远程用户链接到此计算机。另外,退出的时候选择注销,而不是关.
阅读全文
posted @
2013-11-27 18:13
Hi_Amos
阅读(3819)
推荐(1)