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. vc枚举本机端口信息API

    常用的获取端口信息的函数: GetTcpTableGetExtendedTcpTableGetUdpTableGetExtendedUdpTable GetTcp6Table function Get ...

  2. C++:new的使用

    这里先开个头,以后做详细补充个: new 分配内存失败后会返回空指针:

  3. linux 复制文件夹内所有文件到另一个文件夹

    cp -Rf /home/user1/* /root/temp/将 /home/user1目录下的所有东西拷到/root/temp/下而不拷贝user1目录本身.即格式为:cp -Rf 原路径/ 目的 ...

  4. Yii1 用commandBuilder方法往数据表中插入多条记录

    $builder = Yii::app()->db->schema->commandBuilder; // 创建builder对象 $command = $builder->c ...

  5. Linux下安装Redis5.0.2

    1.下载redis 地址 http://download.redis.io/releases/redis-5.0.2.tar.gz 2.解压tar -zxf redis-5.0.2.tar.gz 3. ...

  6. nginx解决跨域(前后端分离)

    Nginx解决跨域问题 后端接口 请求地址 返回数据(json数据) http://127.0.0.1:8080//app Hello World! 前端代码 通过nginx做静态资源服务器访问端口8 ...

  7. Python3使用PyMySQL操作数据库

    1. 安装PyMySQL pip install PyMySQL 关于PyMySQL的详细内容可以查看官方文档  Github 2. 创建表 在某个数据库内,使用以下指令建表 CREATE TABLE ...

  8. PHP+Apache2.x+phpMyAdmin安装和配置

    1>各个部件的下载 目前在windows下开发 PHP官网下载地址:https://windows.php.net/download PHP有TS(ThreadSafe)和NTS两个版本,所以按 ...

  9. 为公司内部搭建CA

    步骤一 首先我们要知道CA的配置文件 openssl的配置文件:/etc/pki/tls/openssl.cnf 我们打开这个配置文件 这文件中很多跟CA相关的信息如图 解释: 我们可以搭建好几个CA ...

  10. Go:文件操作

    一.打开文件和关闭文件 os包File结构体的两个方法: func Open(name string) (file *File, err error) Open打开一个文件用于读取.如果操作成功,返回 ...