AstonJ

AstonJ

Which command line tools do you use?

I’ve been watching Prag Dave’s Elixir course and I noticed he uses tree:

Tree is a recursive directory listing program that produces a depth indented listing of files. Color is supported ala dircolors if the LS_COLORS environment variable is set, output is to a tty, and the -C flag is used. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed.

On Mac install with: brew install tree

EG:

$tree
.
├── README.md
├── lib
│   └── hangman.ex
├── mix.exs
└── mix.lock

You can use the options to ignore directories or files.

Any other cool command line tools you know of or use?

Most Liked

dimitarvp

dimitarvp

In short, a heck ton of them. I can write a series of articles about which tools I use. I made it a credo to gather as much as possible CLI and TUI tools and become master at them. The latter part still eludes me – not enough time and energy still – but I have become quite the small encyclopaedia of CLI/TUI tools.

Waiting for Aston’s “you should write a blog about it Dimi!”. :003:

Hallski

Hallski

Another one for tree, rg and jq.

Some others:

Maartz

Maartz

I like a tool called tl;dr.
It gives you basic knowledge of many commands.
On macOS it’s a good’ol brew install tldr
They also have a nodejs client, so it can be installed with npm.

EG:

❯ tldr grep

grep

Find patterns in files using regular expressions.
More information: <https://www.gnu.org/software/grep/manual/grep.html>.

- Search for a pattern within a file:
    grep "search_pattern" path/to/file

- Search for an exact string (disables regular expressions):
    grep --fixed-strings "exact_string" path/to/file

- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
    grep --recursive --line-number --binary-files=without-match "search_pattern" path/to/directory

- Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
    grep --extended-regexp --ignore-case "search_pattern" path/to/file

- Print 3 lines of context around, before, or after each match:
    grep --context|before-context|after-context=3 "search_pattern" path/to/file

- Print file name and line number for each match:
    grep --with-filename --line-number "search_pattern" path/to/file

- Search for lines matching a pattern, printing only the matched text:
    grep --only-matching "search_pattern" path/to/file

- Search stdin for lines that do not match a pattern:
    cat path/to/file | grep --invert-match "search_pattern"

If a command does not exist, you can add it with a PR on their repo.
It’s a community-based FOSS tool.

Saves me a ton of time in googling and reading man pages.

Popular General Dev topics Top

New
AstonJ
I really like our #general-developer-forum:in-the-news section and am wondering whether we could automate some of the cross-posting of th...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
First poster: dwaynebradley
Maybe it’s just my experience, but Object-Oriented Programming seems like a default, most common paradigm of software engineering. The on...
New
DevotionGeo
I installed Github Copilot (VS Code extension) and signed up for the technical preview three days ago. Yesterday I got the invitation, an...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
First poster: dimitarvp
Rails is not written in Ruby. I’m born and raised in Kraków, a beautiful city in Poland, maybe you’ve heard about it, maybe you’ve even ...
New
First poster: bot
To build a web application you need to make architecture decisions across a range of topics. The beauty of Ruby on Rails or Django is tha...
New
First poster: bot
Raspberry Pi security alarm — the basics. In November last year — I started building a DIY security alarm system, using a Raspberry Pi a...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New