Sometimes when working at the command line, it can be handy to view a file’s contents right in the terminal, or open a file with a certain application. We’ll learn how to view files in the terminal using cat and less and we’ll learn how to open them with open.

View Files:

A good command to view file:

$ less package.json

It shows only the files content without previous commands, and we can use keyboard to control the content display.

To bottom:

$ Shift + g

To top:

$ g

It also enable search content inside file easily:

/mdx

Search for "mdx" inside the file

View Folder:

Sometime when you 'cd' into a folder by using command line, you also want to open the folder to see the files:

open .

It will opens the folder in current path.

You can also use 'open' to open a file by using default IDE:

open package.json

You can also open the folder by telling to using "Webstorm":

open . -a webstorm

[Bash] View Files and Folders in Bash的更多相关文章

  1. [Bash] Find Files and Folders with `find` in Bash

    find is a powerful tool that can not only find files but it can run a command on each matching file ...

  2. [Bash] Move and Copy Files and Folders with Bash

    In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to ...

  3. Mac OS finder : 显示和隐藏文件[夹] show and hide files or folders

    Finder默认是不显示隐藏文件[夹]的,要显示出怎么办? 要显示的话,可以GUI(graphic user interface)和CLI(command line interface)两种方式 CL ...

  4. Track files and folders manipulation in Windows

    The scenario is about Business Secret and our client do worry about data leakage. They want to know ...

  5. -bash: /etc/init.d/nginx: /bin/bash^M: bad interpreter: No such file or directory

    -bash: /etc/init.d/nginx: /bin/bash^M:bad interpreter: No such file or directory 这个使为了弄nginx自启的,然后在官 ...

  6. #VScodd集成Git Bash 命令行 #怎么把Git Bash集成到VScode

    配置 Step1. File-Preferences-Setting Step2. 搜索"terminal>integrated>shell A" Step3. 找到t ...

  7. Bash+R: howto pass parameters from bash script to R(转)

    From original post @ http://analyticsblog.mecglobal.it/analytics-tools/bashr/ In the world of data a ...

  8. [转]COPY OR MOVE FILES AND FOLDERS USING OLE AUTOMATION

    本文转自:http://sqlindia.com/copy-move-files-folders-using-ole-automation-sql-server/ I love playing aro ...

  9. [Bash] Understand and Use Functions in Bash

    n this lesson, we'll go over how bash functions work. Bash functions work like mini bash scripts--yo ...

随机推荐

  1. iview table 已选项的数据 this.$refs.tables.$refs.tablesMain.getSelection()

    iview table 已选项的数据 this.$refs.tables.$refs.tablesMain.getSelection() 由于我这里table组件是套了两层组件 所以是进入了两个层次拿 ...

  2. python基础一 day9 函数升阶(1)

    函数 可读性强 复用性强def 函数名(): 函数体 return 返回值所有的函数 只定义不调用就一定不执行 先定义后调用 函数名() #不接收返回值返回值 = 函数名() #接收返回值 返回值 没 ...

  3. 优先队列 || POJ 1442 Black Box

    给n个数,依次按顺序插入,第二行m个数,a[i]=b表示在第b次插入后输出第i小的数 *解法:写两个优先队列,q1里由大到小排,q2由小到大排,保持q2中有i-1个元素,那么第i小的元素就是q2的to ...

  4. swift中的as?和as!

    as操作符用来把某个实例转型为另外的类型,由于实例转型可能失败,因此Swift为as操作符提供了两种形式:选项形式as?和强制形式as 选项形式(as?)的操作执行转换并返回期望类型的一个选项值,如果 ...

  5. ie8不支持伪类选择器的解决方案

    引用jQuery的插件jquery.pseudo.js插件内容: (function($){ var patterns = { text: /^['"]?(.+?)["']?$/, ...

  6. luogu 1113 杂务--啥?最长路?抱歉,我不会

    P1113 杂务 题目描述 John的农场在给奶牛挤奶前有很多杂务要完成,每一项杂务都需要一定的时间来完成它.比如:他们要将奶牛集合起来,将他们赶进牛棚,为奶牛清洗乳房以及一些其它工作.尽早将所有杂务 ...

  7. 常用字符串匹配算法(brute force, kmp, sunday)

    1. 暴力解法 // 暴力求解 int Idx(string S, string T){ // 返回第一个匹配元素的位置,若没有匹配的子串,则返回-1 int S_size = S.length(); ...

  8. Centos7中yum安装jdk及配置环境变量

    系统版本 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) #安装之前先查看一下有无系统 ...

  9. C#对象初始化的探讨

    最近在弄MQ的性能监测数据埋点,无疑中用到一个Nstatsd的客户端,看到里面写过里面一种嵌套类的写法.代码如下: 客户端Client是一个密封的类,并且构造函数私有访问.然后又用一个嵌套类Curre ...

  10. saltstack快速部署

    yum install wget deltarpm -y wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/rep ...