zoukankan      html  css  js  c++  java
  • [Bash] View Files and Folders in Bash

    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
  • 相关阅读:
    php 原生 好久不写原生demo了
    鸡汤
    php 发送smtp邮件
    php微信支付代码
    3、Flume
    P2761 软件补丁问题
    TQL
    二分图匹配
    p2597 灾难
    P3958 奶酪
  • 原文地址:https://www.cnblogs.com/Answer1215/p/9776015.html
Copyright © 2011-2022 走看看