/r/commandline
This is for anything regarding the command line, in any operating system. All questions (including dumb ones), tips, and links to interesting programs/console applications you've found or made yourself are welcome. Linux / BSD / OSX / Windows CLI and TUI apps or questions or comments, we're happy to take them all!
-----------------------------
/ This is for anything
| regarding the command line, |
| in any operating system. All |
| questions (including dumb |
| ones), tips, and interesting |
| programs/console applications |
| you've found or made yourself |
| are welcome. Please read the |
| rules, and you're welcome to |
| flair your posts if you want |
\ to. / |
---|
\ ^__^
\ (OO)\_______
(__)\ )\/\
||----w |
|| ||
commandline@reddit ~ $ _
If you're asking for help, remember to help the community by stating what OS and version you're using, and if at all possible paste any commands you've tried and any errors or output that you've seen.
Related subreddits:
/r/commandline
HI all, I just released a IP bot detection and IP geolocation command line utility for IPDetective.
You can use it for free without an API key however you may be rate limited depending on the amount of requests you are making.
This tool should help you easily determine the amount of IP addresses that are bots (datacenter, botnet, proxy or VPN) and determine IP country of origin.
Please let me know if you have any questions.
I'm working on a tiny package manager of sorts for tar/tar.gz/tar.xz and similar formats. It works on Linux and macOS for now, but it's built to be portable and extensible so it'll probably be on Windows, BSD and others fairly soon. I use it myself to install annoying programs like Discord.
This was something that was missing from the tools that I currenly use, luckily with a bit of fzf and a single incantation, I had a terminal 'app' doing exactly what I wanted. It uses ripgrep and fd rather than grep and find respectively. Posting in case it is useful:
https://gist.github.com/veebch/e925cbd977ee205c0e495c98a2791352
Tested and working with ncmpcpp. Shared due to my perpetual amazement that you can do this stuff with linux.
Gmail-TUI is a simple TUI application that aims to replicate the Gmail Web-UI in a TUI-Environment. Is this even possible? I don't even know yet but let's find out! Special thanks to Rivo for their TUI Library.
Composing & sending a mail using Gmail-TUI
As shown above (or here if the GIF didn't load), today I was able to implement the composing and sending of Emails using this SMTP guide. The source-code is available in the Project-repository and modifying the code to enhance the project is most welcome!
As scary as this is for me, here I am trying to do something new with my life: Publicly writing about my project so that I actually end up completing it and also hopefully getting the much needed feedback along the way!
Just a few days after I had installed Ubuntu, I lost the access to the GUI due to a failed and interrupted update. This led to me being forced to use the TTY-environment (started using the `ctrl+alt+fkeys` combination) and ending up feeling helpless for a long time as I had never used even the most basic Linux commands.
Months later, this experience led me to look into TUI or Terminal based User Interfaces, which run on Terminals and are like lighter versions of GUIs. This is where the idea of creating my own TUI-Application for Gmail came into mind as I was unable find one that could fit my use-case.
To complete this lack of TUI-Application, I would like the Gmail-TUI to borderline replicate the web-version of Gmail, allowing users to perform most of the core tasks by providing following features/functionalities in it:
I will be trying to work on the login-page for now, where the user will enter their credentials, click on login and be redirected to the next page where they would be able to compose mails. Like the web-version, showing the Inbox after signing-in should be done but since I am still studying IMPS that will help with receiving emails, I will be using the Compose-mail section as the placeholder for now.
A video about using ZLE (Zsh Line Editor) and zsh expansion to build a reusable command line abbreviations engine.
Zoxide is an open-source tool that works like a "smarter CD command"!
It can remember the directories you've already used, allowing you to "jump" to them with just a few keystrokes.
https://reddit.com/link/1gn91rk/video/v408uqbfdvzd1/player
π₯ Check out the video:
https://www.youtube.com/watch?v=gWu7n8A2_DM
Iβve used WindTerm / Guake / iTerm, heard about WezTerm, know any others? Have a preference & why?
Hello! I'm a new computer science student and have been using the terminal more frequently on my Mac. One thing that's been frustrating is not being able to copy filesβsuch as PDFs and imagesβdirectly to the clipboard from the terminal. For instance, Iβd love to type something like copy file.pdf
and then be able to paste it (with Cmd + V
) directly into apps like ChatGPT without having to open the Finder and drag the file in.
Is there a command-line tool or script for macOS that would let me copy files to the clipboard as if they were manually copied? Any tips would be greatly appreciated!
----------------
Edit: A solution was found thanks to u/4esv They suggested using AppleScript with osascript, which works flawlessly. Hereβs the function they shared:
yoink() {
osascript -e "set the clipboard to (POSIX file \"$PWD/$1\")"
}
Hello everybody,
maybe you can help me. The sources on the internet can't anymore.
I have installed aerc and I have create a google mail app password.
I have configured aerc accordingly (IMAP, SMTP, STARTTLS) with that very app password but
unfortunately I can't fetch my emails.
Any idea is more than welcome.
The error I get is:
Googlemail: EOF
Googlemail: reconnecting
Googlemail: reconnect in 3s
Googlemail: reconnect in 2s
Googlemail: reconnect in 1s
Googlemail: reconnecting
This is my configuration:
File: accounts.conf
ββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β [Googlemail]
2 β source = imap://my.name%40googlemail.com:password@imap.googlemail.com:993
3 β outgoing = smtp://my.name%40googlemail.com:password@smtp.googlemail.com:587
4 β default = INBOX
5 β from = "My Name"Β my.name@googlemail.com
6 β cache-headers = true
It should be working because I did create a password with Gmail for the purpose of the app as Google suggests here (16 letters password):Β https://support.google.com/accounts/answer/185833?hl=en
Best regards
It would be nice if I could use fc in shells that don't have it as a built-in. I haven't been able to find anything on GitHub or with Google, but thought I would ask here before I give up.
Just hacked together a fun little terminal reader that lets you weave through books with vim-like navigation while chatting with them using AI.
Navigate like you're in vim: h
/l
between chapters, j
/k
to scroll, g
/G
to jump around β and arrows, ofc
a
sk questions to the text - incl. references to sections, chapters, book & its metadatas
ummarize current sectiont
oggle tocr
ead passageq
uit wheneverAnd my favorite, press >
for an AI narrator that situates you in the current scene/chapter.
Should work with any .epub
file.
Built this because I wanted a more interactive way to "move" around books and go broad or deep in the text using an AI companion. And who knows, perhaps uncover insights hidden in some of these books.
Code & setup instructions: https://github.com/dpunj/weft
Quick demo: https://x.com/dpunjabi/status/1854361314040446995
Would love to hear your thoughts/feedback!
What is a command and what are options in this sequence git push origin main
?
AFAIK, commands that are not Shell-integrated have their own binaries, meaning that git
command should have its binary executable file, making it also a CLI program and not "pure" command.
Starting from this, is git push
another separate command/program with its own binaries? Or push
is an option that was programmed to be passed without the dash character?
I guess origin
is an option? But it's also passed without the dash character.
Hey folks! π
iTerm recently launched their AI feature where you can ask questions in natural language and get commands. But it only supports OpenAI's API, and I'm a Claude user. So I built a fish function that does the same thing!
> ask-claude "flush DNS cache on my Mac"
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
> ask-claude "find large files taking up space"
find . -type f -size +100M -exec ls -lh {} \;
Get a Claude API key from Anthropic Set these in your config.fish:
set -gx CLAUDE_MODEL "claude-3-sonnet-20240229"
set -gx CLAUDE_API_KEY "sk-ant-..."
Drop the function in your fish functions directory
Check it out on GitHub: [ask-claude] (https://github.com/MugunthKumar/ask-claude) PRs welcome! Planning to add support for more shells and Windows in the future.
I'm a Fish user and I'm thinking of switching to Bash, because I want to share scripts and commands with my team, they all have Bash installed. My Fish setup is pretty robust, I have Vi mode,Β atuin
Β for command history, Fish command and argument name completions, syntax highlighting. I'm wondering, do you, people who run Bash on their machines daily, have a way for configuring Bash in a similar way? For what i searched and tried,Β ble.sh
Β provides completions and highlightings, Vi mode is supported by Bash by default, and you can getΒ atuin
Β to work withΒ ble.sh
. ButΒ ble.sh
Β feels kinda laggy and slow, and I don't really like it's Vi mode implementation (i can't evenΒ ctrl-c
Β in there). Is there any alternatives?
Scrapes data from sites and uses AI to extract structured data from it.
I have seem many command line and web applications for scraping but none that are as simple, flexible and fast as ParScrape
AI enthusiasts and data hungry hobbyist
So I have the following .bat file that runs in CMD:
cd C:\Users\xxxxx\AppData\Local\Programs\WinSCP
winscp.exe /console /script="synctolocalscript.txt" /log=mylog.log"
This opens a WINSCP cmd window that actually does the main part to pull some information. So this runs every minute on my PC, but the problem is that every minute I am getting 2 cmd windows popping open and running for about 10 seconds, then closing, so interrupts anything I am working on at the time.
I am still fairly green when it comes to scripting and cmd line stuff, so I am not sure how exactly to make this run silently. Do I do it in the initial cmd line bat file? The synctolocalscript.txt WINSCP file? Or Windows task scheduler where this is scehduled at?
I never developed CLI apps, and was wondering do terminal emulators provide some kind of universal technical standard when it comes to software development? Meaning, is there some specification a developer needs to follow in order for his binaries to be working inside a terminal emulator? Like there are frameworks for building GUI apps, are software terminals (among other things) one of a interface paradigms for developing apps?
I'm trying to determine the current system locale date format so I can format the dates correctly for the schtasks-create command.
Is there a cmd or powershell command that can get me this info?
Hi fellow denizens of the amazing text-box,
I'm the lead developer and maintainer of Zellij - a terminal workspace that does not sacrifice simplicity for power. And I'm here to share the latest release that's hot off the presses. This release includes lots of new cool stuff. Some highlights:
And really, loads more. Check out the official announcement (where you can also see a screencast of me walking you through some of these new features): https://zellij.dev/news/colliding-keybinds-plugin-manager/
And also the full release notes: https://github.com/zellij-org/zellij/releases/tag/v0.41.0
Happy hacking and I hope you enjoy!
I'm encountering a strange issue with Mobaxterm's pasting functionality after rebinding the paste command. I wanted to change the default Ctrl + Shift + Insert to Ctrl + V to make pasting quicker and more intuitive. However, when I try to paste using the new keybind, my CopyQ clipboard manager opens, but nothing actually pastes from it. The same thing happens when I try to use the Windows clipboard. (and its really annoying because I like using the clipboard for pasting sometimes)
To clarify, the Windows clipboard integration hasnβt worked at all, not even with the default settings. Iβve seen suggestions to right-click to paste or simply stick to Ctrl + Shift + Insert, but as a keyboard-focused user, thatβs not an ideal workaround. I work with frequent copy-paste actions, so constantly reaching for the mouse would disrupt my workflow and slow me down.
If Mobaxterm doesn't support custom rebinding for pasting from CopyQ or the Windows clipboard, I might need to explore alternative tools. If anyone has encountered this or found a workaroundβor if thereβs another terminal tool that supports more flexible key bindingsβI'd love to hear your suggestions.
FYI I tried ditto clipboard manager, But it was not able to paste from the clipboard, even with the default settings of mobaxterm, without rebinding anything.
I have a demo!
Here's what the tool does:
Tracks changes made to system or app preferences.
Generates PlistBuddy
commands.
With this, you can script your macOS setup and recreate your environment on new machines.
Now, I know what you're thinking, but let me assure you, I absolutely do not have OCD. If I had a penny for every time someone said they think I have OCD... I'd have 1,526 pennies.
Installation and usage instructions are on GitHub. It's free and open-source. Let me know if you have feedback or ideas!
A tool that allows me to benchmark the major DNS servers on the web (Cloudflare, DNS0, Quad9...). Something like dnsspeedtest.online.
Bonus points if it also allows you to benchmark different protocols: DNS over HTTPS, DNS over TLS, DNS over QUIC...
I can use - dir *.* /b >> list.txt But i need a txt file per file name, not a list of file in a txt folder.
Can anyone help?
https://github.com/jvalcher/termfu
Termfu is my take on a multi-language TUI debugger that allows you to create and switch between custom layouts. All window data is scrollable. Breakpoints and watchpoints persist between sessions. It currently supports GDB and PDB. Header command order, window size and position, (t)itle strings, and key bindings are customizable.