/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
Hello, Im an extreme noob and hope it's okay to ask this here. A friend wrote me a .bat file to use command line to convert mp4 to png and then use gifski to convert to GIF (this is how it works for gifski on Windows - mp4 needs converted to png and then feed the png into gifski to create the GIF). The thing is he has gone on holiday and I don't want to bother him, so I'm trying to figure out on my own. Here is a screenshot of the .bat file he created for me (some instructions are in spanish though):
It works flawlessly, but the only inconvnience is I need to do it file per file. I'd love to just stick all files in one folder and convert them in batch, but I have no idea how. I'v tried following some instructions from google but I'm not being able to succeed.
Sorry if this is too basic, if not allowed please delete! It's just that command line for me is pretty much like reading hieroglyphics
the text browsers are bad at this. does anyone know a git browser? ideally, without downloading the repo: search for repos; browse repos and open the readme; browse and open the issues list; browse the wikis. gh command requires a web browser which is what i am trying to avoid thank you
After almost 3 years of work, I've finally managed to get this project stable enough to release an alpha version!
I'm proud to present Managarr - A TUI and CLI for managing your Servarr instances! At the moment, the alpha version only supports Radarr.
Not all features are implemented for the alpha version, like managing quality profiles or quality definitions, etc.
Here's some screenshots of the TUI:
Additionally, you can use it as a CLI for Radarr; For example, to search for a new film:
managarr radarr search-new-movie --query "star wars"
Or you can add a new movie by its TMDB ID:
managarr radarr add movie --tmdb-id 1895 --root-folder-path /nfs/movies --quality-profile-id 1
All features available in the TUI are also available via the CLI.
https://github.com/spinojara/nchess
nchess supports the full move rules of chess and runs on both Linux and Windows. You can play games, edit and analyze positions. On Linux you can connect UCI engines (i.e. Stockfish), but unfortunately this is not supported on Windows yet.
Please try to break it or make it do weird things as this is the first release!
I wrote a simple cli client for telegram using the telethon library to quickly send files and messages. I would appreciate some feedback. Thanks
so i went to try tmux, wondered why default shortcuts doesn't work, found out that it uses asciiville config, which i forgot that i installed a while back ago
anyway, understood the binds in the config and used it according to that config, however, when i try to delete a whole word using c-backspace (which is set in .zshrc itself, not in the terminal), it doesn't work
tried unbinding, rebinding C-BSpace to ^H, etc, nothing worked
tried `cat` and pressed c-backpace, and nothing printed, usually when i'm outside of tmux, it prints `^H`
here is the tmux config
## Custom key bindings
# Switch windows using Alt-PgDn and Up without prefix
# bind-key -n M-Right next-window
# bind-key -n M-Left previous-window
# bind-key -n M-n next-window
# bind-key -n M-p previous-window
bind-key -n M-PgDn next-window
bind-key -n M-PgUp previous-window
# Switch panes using Alt-arrow without prefix
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
# Resize panes
# bind-key -r C-Left resize-pane -L 5
# bind-key -r C-Right resize-pane -R 5
# bind-key -r C-Up resize-pane -U 2
# bind-key -r C-Down resize-pane -D 2
#
# Use vim key bindings and mode
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize-pane -L 5
bind -r m resize-pane -Z
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode when dragging with mouse
# Exit session
bind-key -n M-x confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key -n M-X kill-session
bind-key q confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key Q kill-session
# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Reload config file
unbind r
bind-key r source-file ~/.tmux.conf\; display ' Reloaded tmux config.'
# Split panes using | and -
bind-key | split-window -h -c '#{pane_current_path}'
bind-key - split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %
# Shift + arrow key to move between windows
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
# Sync panes
bind-key s set-window-option synchronize-panes
Why?
I was reading Linus' book, "Just for Fun" and he was talking about when was working with his Sinclair QL, he hated the text editor that came with it, because it was so slow, so he wrote his own in assembly which was significantly faster. Later he also was working on a terminal emulator with assembly to learn the architecture of his computer and he ended up writing his own kernel that we all know and love.
So I also wanted to make something like that, i thought I'd do a terminal, because you get some part of building a text editor and some experience with the os and important system calls. I obviously wasn't gonna use assembly, because I'm not good with it and even if I was I couldn't imagine writing more efficient code that would make it faster than C with all the compiler optimizations these days.
Anyways it's currently at a very basic level, it currently doesn't even support scrolling and I'm implementing that, this very moment. I was thinking of having a circular connected lines of text, so that if the last line is filled, the next line is stored in the first (0th) line and then the original line at that place must be stored somewhere? Idk i want to do something quick, and don't wish to move memory and create more memory everytime i have to scroll
I've used Pty/pseudoterminals to emulate shell, thanks to a tutorial by eduterm
I'll be happy to work on some suggestions.
Hey everyone, I wanted to share and get feedback on my pet project that quickly became a pillar of my current engineering workflow.
https://github.com/efugier/smartcat/
First of all, I am aware of other initiatives. Let me get straight to why this may be different, and why it works better for me than any other tool I've tried.
This tool makes LLMs available as text manipulation entities in the CLI; you pipe text in and you get some result. smartcat
is designed to make this pattern and all its many applications as efficient and straightforward as possible.
You can pipe in a simple question, some text to reformat, explain a stack trace, refactor some code, write the v0 of some function to iterate on, a quick script etc.
In the end, with it being available in terminal and editor (vim, kakoune, helix... all support piping selection into the CLI), it completely eliminated the need for Copilot and other completion tools for me. I much prefer the workflow and control this offers.
Now, feature-wise, what are the highlights?
More details (and workflow gifs) in the README.
As the target audience for this tool I would love for you to share feedback, especially on the documentation and README as it's always hard to accurately gauge how confusing things can be when you're the one that built it.
I hope you find it as useful as I do!
For instance, I want to replace the nf-md-numeric_1_circle_outline
icon (you can search that in https://www.nerdfonts.com/cheat-sheet to see), with this Apple SF Symbol 1.circle
instead. I use a nerd font in Neovide (an Nvim GUI), where I can paste in the text character for 1.circle
and it shows correctly without additional steps. On nerdfonts.com, it says at the bottom "You can even specify a custom symbol font with the --custom
option to include even more glyphs." but I didn't find any instructions for how exactly to make a font file with the glyphs I want. I want to be able to overwrite any nerd icon with one in the SF Symbols app.
Hi everyone! 👋
I’m exploring the idea of a plug-and-play analytics solution designed specifically for CLI applications — think Google Analytics, but tailored to CLI tools. Here’s a rough outline of what I envision:
I started thinking about this after hitting roadblocks in prioritizing features and fixing bugs in my own open-source CLI tool. Now, I’m curious to know if others see value in a tool like this.
Does this sound useful for your CLI projects? Are there any features you’d need or concerns you’d have?
Any feedback would be hugely appreciated 🙏 Thank you in advance!
The header says is all. I typed ld instead of ls. Nothing happened for a few seconds so I CTRL+C‘d. Then I remembered ld is the linker and I tried the usual to find out, if sth. happens, if you run it without any parameters, but it doesn’t look like. I now also get an error, if I just type ld. Is it normal that some tools take a little longer, if you execute them for the first time (I guess ld has been run before internally, hasn’t it)? Also, is it bad in anyway, if you cancel the first execution with an CTRL+C? Will you interrupt some kind of initialization?
Fabric is a real time saver for many repeatable tasks when using AI in terminal.
To make it a little easier to use, I've created a simple script to orchestrate fabric commands.
Here is a video about it if anyone is interested.
hi im trying to find a script to compare 2 directories full of audio files from a Visual novel
and for it to only keep the audio files that the length/duration is longer
the file extension is .ogg
the directories are
$folder1 = "D:\Newfolder3\Newfolder\test\"
$folder2 = "D:\Newfolder3\Newfolder2\Newfolder\test\"
and for the story i made the fruit of grisaia patch for the steam
but recently i found out some of the lines are cut off
due to the censorship of the steam version
so i have all the lines of the unrated version in 1 folder
and the lines from the steam version in another
the unrated would have the longer dialog
hence if i have a script to automatically do this
it would be a huge help since there are almost 25,000 audio files in each folder
update:
i think i got a script that does the job with file size instead
# Define the directories
$dir1 = "D:\Newfolder3\pcm1\"
$dir2 = "D:\Newfolder3\pcm2\"
# Get the list of files in directory 1
Get-ChildItem -Path $dir1 | ForEach-Object {
$file1 = $_
$file2 = Join-Path -Path $dir2 -ChildPath $file1.Name
# Check if the corresponding file exists in directory 2
if (Test-Path -Path $file2) {
# Get the file sizes
$size1 = $file1.Length
$size2 = (Get-Item $file2).Length
# Compare sizes (100 KB = 102400 bytes)
if ($size1 + 102400 -le $size2) {
Write-Host "Deleting $($file1.FullName) (size: $size1 bytes) because $($file2) (size: $size2 bytes) is larger by at least 100 KB."
Remove-Item -Path $file1.FullName -Force # Delete the file
}
}
}
I'm trying to brainstorm a solution for a way to capture history locally across multiple remote sessions for multiple accounts. Basically I want a .bash_history file for me, the human, not my various accounts across systems. I tried doing something with a local keylogger, but in addition to capturing passwords, the output there is not very useful:
cd /h[TAB]m[TAB]bi[TAB][^A][DEL][DEL]ll[^M]
Example scenario: I need to run a diagnostic command as user1@server1 and upload the results to the vendor via my browser.
diag.sh > ~/output1
cp /home/user1/output1 /home/me/
chown me:me /home/me/output1
scp me@server1:output1 .
I'd love some way to have a local file with the following contents:
[2024-10-15 17:30:57] me@localhost ssh me@server1
[2024-10-15 17:31:02] me@server1 sudo -iu user1
[2024-10-25 17:31:05] user1@server1 diag.sh > ~/output1
[2024-10-25 17:32:18] user1@server1 exit
[2024-10-15 17:32:20] me@server1 sudo su -
[2024-10-15 17:32:23] root@server1 cp /home/user1/output1 /home/me/
[2024-10-15 17:32:26] root@server1 chown me:me /home/me/output1
[2024-10-15 17:32:28] root@server1 exit
[2024-10-15 17:32:44] me@localhost scp me@server1:output 1 .
So I have the craziest idea to install debian on outaded pda so first I'm wondering on amazing sony Vaio ux 390n which by this pc was Thanks to such a computer, the ssd was born if I fail by grub rescure will try to install in some old pda or unknown retro thinkPad tablet with build in keyboard (what model?) or even apple powerbook.
This program was previously in Python i just re-wrote the entire thing in go lang.
Features: Stream and track anime, Anilist integrations, Discord RPC, Skip Intro/Outro/Filler/Recap, etc.
Works in windows and linux
Checkout the project here Github
Title. Been looking for something like that since forever and I can't find it -- can someone give me pointers? Thanks in advance.
(MacOS 10.15.7 if it matters)
I recently got a VPN and to activate it after rebooting my computer i have to load the .conf file with Wireguard using the command "sudo wg-quick up ./configfile.conf
", and then i have to enter my password.
I would like to create a script that does this for me so i don't have to type it all in the Terminal every time I start my Mac. However, when I run the script it obviously still asks for my password. What can I put in the script that will bypass that?
Thanks in advance to anyone who can help me with my beginner question, I'm new to this stuff but I'm excited to learn!
Hi,
I would like to update a json with data from another json, but i have no clue how to do this using jq.
A.json:
[
{
"name": "a",
"files": [
"a",
"aa"
]
},{
"name": "b",
"files": [
"b",
"bb"
]
}
]
B.json:
[
{
"name": "b",
"files": [
"b",
"bb",
"bbb",
"bbbb",
]
}
]
restult.json
[
{
"name": "a",
"files": [
"a",
"aa"
]
},{
"name": "b",
"files": [
"b",
"bb"
"bbb",
"bbbb",
]
}
]