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.

Where Next?

Popular General Dev topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
I just watched this: (tldr: remove bad choices so you don’t need to use willpower) It got me thinking about ways to incre...
New
AstonJ
If you could work on any project, what would it be? :upside_down_face:
New
chasekaylee
Hi there! I have some old Bose in ear noise cancelling headphones that have worked like a champ for the past 3 years and was maybe due fo...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
jamiedumont
This is all going to be a bit hand-wavey and straight off the top of my head, so bear with me, but it’s a thought/debate that’s been ratt...
New
ohm
I just switched jobs to tech lead with a small team of about 6 other developer. This is my first tech lead job. What do I need to know? A...
New
chaptuck
I am thinking about getting a fitness tracker of some kind (probably one from Garmin). Have any of you developed your own widgets, watchf...
New
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1030 17300 381
New
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
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1142 25749 758
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New