/r/commandline

Photograph via snooOG

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

97,813 Subscribers

0

Where to put my own shell scripts and configuration files?

Could anybody explain, in which directory (or directories) I should place my own shell scripts and configuation files on macOS?

  • /usr/local/bin/?
  • /usr/local/etc/?
  • $HOME/bin/?
  • $HOME/etc/?
  • ... ?

A best practice or a most common way?

Example files are:

  • webpage2pdf.zsh - an ImageMagick script to convert a webpage to PDF
  • .webpage2pdf - a configuration file for it
  • .zshrc_my-own - a Zsh cofiguration file that is sourced in my ~/.zshrc using source, as suggested by Gilles to avoid accidental overridings: https://unix.stackexchange.com/a/787409
2 Comments
2024/12/01
22:06 UTC

32

New Release of kanban-tui, a multi-board kanban/task manager

2 Comments
2024/12/01
18:53 UTC

12

A retro-looking TUI version of history command programmed in C. https://github.com/velorek1/his/

4 Comments
2024/12/01
16:36 UTC

1

PDF to DXF help needed

Hi everyone,

I'm trying to convert a technical drawing in PDF format into a DXF that can be laser cut.

I tried

  • inkscape: produces only empty output files
  • pstoedit: crashes with a 'assertion failed. Core dumped' error
  • pdf2svg and then magick from svg to dxf. But the resulting file can't be opened in lightburn.

Any help would be appreciated.

1 Comment
2024/12/01
16:05 UTC

5

How to setup warp like prompt?

I tried warp, and the prompts seems pretty cool. How do you achieve that without using warp? I assume it wouldn't be that hard and someone would've done it

6 Comments
2024/12/01
05:58 UTC

1

alternative to caffeine extension to ubuntu.

I need some help. What I want to know is if there is any terminal app, like caffeine extension of gnome, that I can install, that it's already on the ubuntu repository.

2 Comments
2024/11/30
19:24 UTC

22

Very Simple Command Line Journal

Hi, I've created an encrypted-journaling command-line application inspired by https://jrnl.sh It is just a single bash script for the app, and another script for the setup. I wanted something that was dead simple, and something that does not have too many dependencies.

The idea is to use existing tools to just start writing, and have the records automatically arranged in a specified folder.

Please check out the project here: https://github.com/nilz-bilz/cli-jrnl and let me know if there are any changes or improvements you guys would like to see. I haven't yet tested this on mac and other Unix systems, so it would be great to get some feedback on those platforms as well. Thanks

4 Comments
2024/11/30
12:04 UTC

4

is there a simpler cli tool for cropping images, or should I just stop being lazy and learn how to use imagemagick?

I want to take an image that is too wide to work as a wallpaper for my monitor (ie: a 32:9 wallpaper while I'm using my 21:9 monitor, or a 21:9 or 32:9 wallpaper while I'm using my laptop with no external monitor) and cut it into 10 equally spaced slices to show on my 10 workspaces, I'm hoping to get the same effect as on my android phone, where as I swipe to the right, it pans to the right on my background image.

A more concrete example, if I have a 5120x1440 image, and I'm using my 3440X1440 monitor, I want to create 10 horizontally cropped slices of the image. 1st going from 0-3440, 2nd going from 168-3608, 3rd going from 336-3773, etc incrementing by 168 each time (168 comes from (width of the original image - goal width)/number of workspaces, so (5120-3440)/10).

I can work out on my own how to script everthing else to work, what I need to figure out is how to make a script:

  1. check the resolution of whatever next wallpaper it picks
  2. if necessary create the image slices for each workspace

Is there a simpler tool to do that or should I just learn Imagemagick? I'm under the impression that imagemagick is in the same tier as ffmpeg as far as power and complexity, is this true or am I just avoiding it for nothing?

11 Comments
2024/11/29
22:51 UTC

0

Change local machine admin to other workstations in domain?

What would be the commands for that if I wanted to change lets say 40% of PC's local machine admin passwords? Only by using cmd. Or atleast to one person?

1 Comment
2024/11/29
14:47 UTC

82

elastop - HTOP for Elasticsearch

7 Comments
2024/11/29
05:42 UTC

23

yt-dlp supports most media urls include reddit

I learned today, that I could extract a reddit video using yt-dlp, which I normally use for Youtube content.

First, you need to review the codecs and figure out which video/audio streams you want to use.

 $ yt-dlp -F https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] Extracting URL: https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] 1gzg8wu: Downloading JSON metadata
[Reddit] 1gzg8wu: Downloading m3u8 information
[Reddit] 1gzg8wu: Downloading MPD manifest
[info] Available formats for 3wfqau4r113e1:
ID       EXT RESOLUTION FPS â   FILESIZE   TBR PROTO â VCODEC        VBR ACODEC     MORE INFO
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
dash-4   mp4 854x480        â ~  1.72MiB  335k https â avc1.4d401f  335k video only DASH video, mp4_dash
hls-272  mp4 854x480     30 â ~  1.39MiB  272k m3u8  â avc1.4D401F  272k video only
dash-5   mp4 1280x720       â ~  2.90MiB  566k https â avc1.4d401f  566k video only DASH video, mp4_dash
fallback mp4 1280x720       â â 12.30MiB 2400k https â h264        2400k video only DASH video, mp4_dash
hls-429  mp4 1280x720    30 â ~  2.20MiB  429k m3u8  â avc1.4D401F  429k video only

Then you extract the video. In this example, only the video codecs are available.

$ yt-dlp --format  dash-4 https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] Extracting URL: https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] 1gzg8wu: Downloading JSON metadata
[Reddit] 1gzg8wu: Downloading m3u8 information
[Reddit] 1gzg8wu: Downloading MPD manifest
[info] 3wfqau4r113e1: Downloading 1 format(s): dash-4
[download] Destination: Docfd 9.0.0-rc1ï¼ TUI multiline fuzzy document finder [3wfqau4r113e1].mp4
[download] 100% of    1.21MiB in 00:00:00 at 8.46MiB/s
-rw-r--r-- 1 XXX XXX 1267032 Nov 25 04:56 Docfd 9.0.0-rc1ï¼ TUI multiline fuzzy document finder [3wfqau4r113e1].mp4
3 Comments
2024/11/28
23:56 UTC

36

Bonsai Tree Generator for Bonsai-CLI (php port for cbonsai)

1 Comment
2024/11/28
22:32 UTC

6

Best command line tool to diff two texts without creating files?

I know I can vimdiff two files, but in the case it's two texts I can grab them from the clipboard, can I avoid creating files?

11 Comments
2024/11/28
21:19 UTC

0

🚀 [Project] youGotMail - Rust-Based Email Spammer (using Gmail Accounts)

Hey everyone!

I just finished building a simple but powerful email spammer called youGotMail in Rust. It allows you to send emails to a list of targets using your own Gmail accounts.

Key Features:

  • Rust-Based: Written in Rust for speed and efficiency.
  • Gmail Integration: Uses your Gmail account credentials to send emails.
  • Target List: You can provide a list of email addresses to which the mails will be sent.

Usage:

  • Clone the repo: git clone https://github.com/NewDawn0/youGotMail
  • Set up your Gmail account.
  • Modify the target email list in the config.
  • Run the program to send emails.

GitHub Repo:

👉 youGotMail GitHub

🚨 Legality Disclaimer:

Please be aware that I, the author, am not responsible for any misuse of this tool. Use it at your own risk.**

3 Comments
2024/11/28
14:40 UTC

0

Building a TCP Chat in Go

0 Comments
2024/11/28
11:26 UTC

36

bookbrowse - search books within your terminal

5 Comments
2024/11/28
08:57 UTC

1

Fetchmail crontab for flushing email

Hello.

Internally, I use fetchmail to consolidate my various domains into one master local server. I keep the last ~7 days on the remote server, until they are purged, so that I can still view urgent messages using webmail.

This is a basic crontab to use with fetchmail, when using the 'keep' directive.

MAILTO=""
*/5 * * * * cd $HOME; flock "/var/lock/fetchmail.$(whoami).lock" fetchmail
01  0 * * 0 cd $HOME; flock "/var/lock/fetchmail.$(whoami).lock" fetchmail --flush
2 Comments
2024/11/27
22:22 UTC

0

Easiest way to write some text into the google ecosystem, from the command line of a headless machine?

Hey hey,

I have some ubuntu machines and i use the google ecosystem since many years. Sometimes i think of things i want to remember, when i'm sitting at a terminal. What would be the easiest way to get a note on to the google ecosystem (or in worst case, some other cloud/server service) ?

I don't really need to read what is already there, but i would like to put something on to the stack, if you see what i mean. I can later review and edit/compile the notes, from a desktop machine.

NB: these are headless machines i am SSH:ing into.

20 Comments
2024/11/27
21:26 UTC

2

script writing help

r/bash deleted my post instantly, so here i post.

I run minecraft on my laptop while linking the datafile to an smb share.

So every time I want to play, i need to mount said share, and THEN open the mc app. I created a script that does that for me automatically, but i see it returning a strange message.

i'm pretty much a noob in writing code, but i try my best replicating what i watch on yt😅.

these are the two scripts i made

connectmc

#!/bin/bash
mkdir ~/Desktop/mclink ; mount_smbfs //user@server/Desktop ~/Desktop/mclink && echo Server Connected && open -a minecraft || echo Server Not Connected ; rmdir ~/Desktop/mclink 

ejectmc

#!/bin/bash
killall launcher ; sleep 5
umount ~/Desktop/mclink && rmdir ~/Desktop/mclink && echo Server Disconnected

so, after all that introduction.

my connection script returns both a success message and an error to rmdir

can anyone tell my why im getting this?

 $ connectmc 
Server Connected
rmdir: /Users/user/Desktop/mclink: Resource busy

ejectmc works fine btw😁!

16 Comments
2024/11/27
20:20 UTC

6

Problem with Zoxide: cd not adding folders

SOLVED. See below

I've installed zoxide as an apt package on a fresh ubuntu install, version 0.9.3, in Bash.
I have the required:

eval "$(zoxide init bash)"

In the .bashrc.
The question is the history is not building correctly on its own. An example:

https://preview.redd.it/qnjiaxpp0h3e1.png?width=779&format=png&auto=webp&s=cea946e0633e0da6c5d8e1c205bc8ff20ccc22db

I can add a directory manually with zoxide add, but it's very inconvenient, kind of messes up the main strength of the tool.

Any help will be much appreciated, thanks in advance

Solution
The issue was I was loading zoxide and then changing the PROMPT_COMMAND later in my .bashrc Moving it below solved it. Thanks to u/mattmc3

6 Comments
2024/11/27
16:28 UTC

35

🧩 x webtop - Run multiple Linux desktops in Docker, accessible via your browser

9 Comments
2024/11/27
10:32 UTC

61

I made this tool to turn any repo into a docker image

17 Comments
2024/11/27
05:15 UTC

26

What are some good cli screensavers (or similar) that I could use while running my server?

I am setting up this server as a code lab so my friends can use it. What can I run in the background as something cool to look at while I am at away?

I am currently using asciiquarium.

14 Comments
2024/11/26
07:18 UTC

11

[Yazi] Noob here. What went wrong here?

27 Comments
2024/11/25
18:49 UTC

Back To Top