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. 摄像头调用代码 笔记本的话,本身有一个摄像头,由于用的usb摄像头,需要把笔记本的摄像头禁用后,再使用

    摄像头调用代码 笔记本的话,本身有一个摄像头,由于用的usb摄像头,需要把笔记本的摄像头禁用后,再使用 <!DOCTYPE html> <html lang="en&quo ...

  2. import downloadjs from 'downloadjs' 如果是自己写的函数 没用默认导出 记得加花括号 例如 import { download } from './data.js'

    import downloadjs from 'downloadjs' 如果是自己写的函数 没用默认导出 记得加花括号 例如 import { download } from './data.js'

  3. python之range (范围)

    例题: for i in range(10): print(i,end='') # 输出结果 0123456789 # s = range(1,10) # 面试大坑 python2 和 python3 ...

  4. 自定义函数导致的sql性能问题

    同事说,某某报表跑的很慢,让我调查一下 优化前:该报表整体需要跑4小时以上. sql代码如下 SELECT /*省略多数查询字段*/ REP_FUN_REFCODEVALUE /*自定义函数*/ (P ...

  5. qt 窗体间通信

    利用qt的信号和槽,可以完成窗体间的通信,下面列出父子窗口利用信号和槽的相关代码. parent窗口: //parent.h #ifndef PARENT_H #define PARENT_H #in ...

  6. 学习vue之windows下安装live-server 超级详细篇

    最近项目要求用vue2.0所以开始着手学习. 前期准备: 下载Node.js 地址:http://nodejs.cn/download/ 选择自己对应的版本,我下载的是.msi 64位的 然后就双击下 ...

  7. python 闭包&装饰器(一)

    一.闭包 1.举例 def outer(): x = 10 def inner(): # 内部函数 print(x) # 外部函数的一个变量 return inner # 调用inner()函数的方法 ...

  8. 《算法导论》 — Chapter 8 线性时间排序

    序 到目前为止,关于排序的问题,前面已经介绍了很多,从插入排序.合并排序.堆排序以及快速排序,每一种都有其适用的情况,在时间和空间复杂度上各有优势.它们都有一个相同的特点,以上所有排序的结果序列,各个 ...

  9. 【HIHOCODER 1469 】福字(DP)

    描述 新年到了,你收到了一副画.你想找到里面最大的福字. 一副画是一个n × n的矩阵,其中每个位置都是一个非负整数. 一个福字被定义成是大小为 k 的正方形,满足其中的每个位置上的数都恰好比他的左边 ...

  10. shell if判断总结

    一.if的基本语法: if [ command ];then    符合该条件执行的语句 elif [ command ];then    符合该条件执行的语句 else    符合该条件执行的语句 ...