Prerequisite: Linux Command Line(I): Beginner

================================

File I/O

$ cat > a.txt  #create a file 'a.txt' and appends things into it

Type random stuff...

# press Ctrl+d to exit editting

$ cat a.txt

Type random stuff...

$ cat > a.txt  #'single >' for overwriting the entire document 

Overwritting in process...

#Ctrl+d

$ cat a.txt

Overwritting in process...

$ cat >> a.txt  #'double >>' for  appending to the EOF

appending in process...

#Ctrl+d

$ cat a.txt

Overwritting in process...

appending in process...

==================

Concatenating 2 txt files

cat a.txt b.txt > out.txt  #transfer the content of these 2 .txt and to a new .txt

cat a.txt b.txt > b.txt    #error! using 'cat <' input and output cannot be same

cat a.txt >> b.txt    #okay: content of a.txt appends to b.txt

==================

 Mkdir

Greedy method: >2 directories at a time

mkdir -p notebook/new

mkdir -p /notebook/new  #error!

mkdir -p friends/{John, Tom, Amy}  #with space, only 1 directory created

mkdir -p friends/{John,Tom,Amy}  #3 directories created

rm -r friends   #remove non-empty directories & itself

===================

cd

cd ..  # go up one directory

====================

output script into txt 

script out.txt

# type some commands

exit

====================

remove all files within a directory without removing the folder

rm Documents/*  #suppose we are at /root

===================

Linux Command Line(II): Intermediate的更多相关文章

  1. [笔记]The Linux command line

    Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...

  2. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  3. 《The Linux Command Line》 读书笔记02 关于命令的命令

    <The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...

  4. 《The Linux Command Line》 读书笔记01 基本命令介绍

    <The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...

  5. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  6. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  7. 15 Examples To Master Linux Command Line History

    When you are using Linux command line frequently, using the history effectively can be a major produ ...

  8. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

  9. Reso | The Linux Command Line 的中文版

    http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...

随机推荐

  1. yii2.0修改默认的访问控制器

  2. 一些爬虫中的snippet

    1.tornado 一个精简的异步爬虫(来自tornado的demo) #!/usr/bin/env python import time from datetime import timedelta ...

  3. AJAX数据请求

    ajax数据请求需要四个步骤:(请求文本内容) 1.创建XMLHttpRequest对象: 2.打开与服务起的链接: 3.发送给服务器: 4.响应就绪. <!DOCTYPE html> & ...

  4. Android如何实现定位获取

    一:GPS定位: (1).要实用Adnroid平台的GPS设备,首先需要添加上权限,所以需要添加如下权限: uses-permission android:name= android.permissi ...

  5. Vue中应用CORS实现AJAX跨域,及它在 form data 和 request payload 的小坑处理

    基本概念部分(一):理解CORS 说道Vue的跨域AJAX,我想先梳理一遍CORS跨域,"跨域资源共享"(Cross-origin resource sharing),它是一个W3 ...

  6. C#调用TSC条码打印机打印二维码

    #region 调用TSC打印机打印 /// <summary> /// 调用TSC打印机打印 /// </summary> /// <param name=" ...

  7. 【JS】jquery通知插件toastr

    toastr是一款非常棒的基于jquery库的非阻塞通知提示插件,toastr可设定四种通知模式:成功,出错,警告,提示,而提示窗口的位置,动画效果都可以通过能数来设置,在官方站可以通过勾选参数来生成 ...

  8. Excel文件按照指定模板导入数据(用jxl.jar包)

        本文中的方法只适合Excel2003,要读取Excel2007最好使用poi.jar,据说poi.jar还在更新,jxl.jar已经不更新了,处理Excel文件的读写问题最好还是学习poi.j ...

  9. (转载)Oracle10g 数据泵导出命令 expdp 使用总结(一)

    原文链接:http://hi.baidu.com/edeed/item/890626ef6f6d9d265b2d646f Oracle10g 数据泵导出命令 expdp 使用总结(二)Oracle10 ...

  10. java操作DBF的使用

    1.引入javadbf.4.1.jar 2. import com.linuxense.javadbf.DBFField;   import com.linuxense.javadbf.DBFRead ...