• Sign in
  • Sign up
Elektrine
EN
Log in Register
Modes
Overview Chat Timeline Communities Gallery Lists Friends Email Vault DNS VPN
Back to Timeline !linux @ArcaneSlime
In reply to 4 earlier posts
@marighost@piefed.social on piefed.social Open parent
What are some of your most useful or favorite terminal commands?
I’ve been setting up a new Proxmox server and messing around with VMs, and wanted to know what kind of useful commands I’m missing out on. Bonus points for a little explainer. Journalctl | grep -C 10 'foo' was useful for me when I needed to troubleshoot some fstab mount fuckery on boot. It pipes Journalctl (boot logs) into grep to find ‘foo’, and prints 10 lines before and after each instance of ‘foo’.
Open parent Original URL
0
0
0
@InFerNo@lemmy.ml on lemmy.ml Open parent
I use $_ a lot, it allows you to use the last parameter of the previous command in your current command mkdir something && cd $_ nano file chmod +x $_ As a simple example. If you want to create nested folders, you can do it in one go by adding -p to mkdir mkdir -p bunch/of/nested/folders Good explanation here: koenwoortman.com/…/q Sometimes starting a service takes a while and you’re sitting there waiting for the terminal to be available again. Just add --no-block to systemctl and it will do it on the background without keeping the terminal occupied. systemctl start --no-block myservice
Open parent Original URL
0
0
0
@ArcaneSlime@lemmy.dbzer0.com on lemmy.dbzer0.com Open parent
Is there a version of $_ that works with mv? It just keeps renaming my files to “filedir,” I’m trying sort through a directory and move some files to another for keeping, be easier if I could do: mv picture1.jpg /path/to/keepdirectory then do something like mv picture2.jpg $_ And so on. But with that I’d just be renaming all my photos “filedir” instead of moving them lol.
Open parent Original URL
0
0
0
@InFerNo@lemmy.ml on lemmy.ml Open parent
I just tried your use case, and it did move the files to the correct folder. using zsh: user@computer  ~  touch test.jpg user@computer  ~  touch test2.jpg user@computer  ~  mv test.jpg ./Public user@computer  ~  mv test2.jpg $_ user@computer  ~  ls ./Public test2.jpg test.jpg user@computer  ~  using bash: [user@computer Public]$ mkdir test [user@computer Public]$ ls test test2.jpg test.jpg [user@computer Public]$ mv test.jpg ./test [user@computer Public]$ mv test2.jpg $_ [user@computer Public]$ ls test [user@computer Public]$ ls test/ test2.jpg test.jpg [user@computer Public]$ using bash and full path: [user@computer Public]$ ls test test2.jpg test.jpg [user@computer Public]$ mv test.jpg /home/user/Public/test [user@computer Public]$ mv test2.jpg $_ [user@computer Public]$ ls test [user@computer Public]$ ls test/ test2.jpg test.jpg [user@computer Public]$ What shell are you using? You can check it by using echo $0. user@computer  ~  echo $0 /usr/bin/zsh [user@computer ~]$ echo $0 /bin/bash I can’t reproduce it, even when putting the directory path in quotes, it still simply moved the file.
Open parent Original URL
0
0
0
0
ArcaneSlime in !linux
@ArcaneSlime@lemmy.dbzer0.com · 15d
On bash I found out alt+. puts the last last parameter back up, and you can hit it again to keep cycling, that’s what I’ve been using.
View on lemmy.dbzer0.com
0
0
0
Sign in to interact

Loading comments...

About Community

linux
Linux
!linux@lemmy.ml

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules
  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc
Related Communities
  • !opensource@lemmy.ml
  • !libre_culture@lemmy.ml
  • !technology@lemmy.ml
  • !libre_hardware@lemmy.ml

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

64661
Members
10904
Posts
Created: June 01, 2019
View All Posts
313k7r1n3

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • VPN Policy

Email Settings

IMAP: mail.elektrine.com:993

POP3: pop3.elektrine.com:995

SMTP: mail.elektrine.com:465

SSL/TLS required

Support

  • support@elektrine.com
  • Report Security Issue

Connect

Tor Hidden Service

khav7sdajxu6om3arvglevskg2vwuy7luyjcwfwg6xnkd7qtskr2vhad.onion
© 2026 Elektrine. All rights reserved. • Server: 18:41:23 UTC