What useful functions do you know like ipconfig?
from sopularity_fax@sopuli.xyz to nostupidquestions@lemmy.ca on 27 Nov 21:38
https://sopuli.xyz/post/37344573

Doesnt have to be internet related, just useful shtuffs

#nostupidquestions

threaded - newest

slazer2au@lemmy.world on 27 Nov 22:45 next collapse

ip a
du -dh

sopularity_fax@sopuli.xyz on 27 Nov 22:53 next collapse

Wat do they do?

667@lemmy.radio on 28 Nov 01:54 next collapse

I managed to find this about ip and its various switches: www.man7.org/linux/man-pages/man8/ip.8.html

tal@lemmy.today on 28 Nov 02:41 collapse

I’m not at a Linux machine at the moment, but ip a is probably short for “ip addr”, which shows the local machine’s IP address with iproute2 (historically, one would have used OP’s ifconfig).

I dunno -d off the top of my head, but du -h shows, using “human readable units” — like “M” for megabyte, etc, the size of all the files below each directory starting at the current one. It pairs well with sort -h, which can sort those units — du -h | sort -h is a nice way to get an overview of what is eating up your disk space.

Sunsofold@lemmings.world on 28 Nov 22:47 collapse

Beer and ‘Du…Du hast…?’

lvxferre@mander.xyz on 28 Nov 02:10 next collapse

Not quite a function but a small program: xdotool, that simulates keyboard and mouse activity. For plenty games xdotool and bash are all you need for an amazing (albeit simple) autoclicker. For example:

# Clicks the screen every 40ms. Great for Cookie Clicker and similar games.
if [[ $(xset -q | grep -o "Scroll Lock: off") == "Scroll Lock: off" ]]; then xdotool key Scroll_Lock; fi
  ScrollStatus=$"Scroll Lock: on"
  while [[ $(xset -q | grep -o "Scroll Lock: on") == "Scroll Lock: on" ]]; do
    xdotool click --repeat 4 --delay 40 1
    done

# Goes up, then down, then presses C. I use it to farm BP in Final Fantasy V, in an emulator.
if [[ $(xset -q | grep -o "Scroll Lock: off") == "Scroll Lock: off" ]]; then xdotool key Scroll_Lock; fi
  ScrollStatus=$"Scroll Lock: on"
  while [[ $(xset -q | grep -o "Scroll Lock: on") == "Scroll Lock: on" ]]; do
    xdotool key Up; xdotool key Down; xdotool key c
    done

This you assign the script to a shortcut, press it to turn it on, and Scroll Lock to turn it off.

It gets even better - with grabc (another small program, that probes the colour of a pixel), you can even make autoclicking scripts that react to changes in the game screen.

EDIT: as Tal highlighted, xdotool is for X11. It works with Wayland… a bit, most functions are broken. Wayland users are better off using ydotool. Same basic idea, though - you don’t need to click it, you can tell your computer to do it for you!

tal@lemmy.today on 28 Nov 02:36 collapse

Note that xdotool is specific to X11. Ydotool can do some similar things in Wayland.

lvxferre@mander.xyz on 28 Nov 02:49 collapse

True - I’ll edit my comment to include this info.

sem@piefed.blahaj.zone on 28 Nov 03:16 next collapse

grep, pastebinit

tldr

swapon

htop

music123

pavucontrol

ls -la

touch

tail -F

journalctl -u whatever.service

walden@wetshav.ing on 28 Nov 03:33 next collapse

I love ncdu for displaying file and folder sizes. I have a couple of small VPS’s and it’s handy for finding where all the disk space has gone.

ace_garp@lemmy.world on 28 Nov 05:32 next collapse

ls -ltrc --> show the files in newest order

Is -lSr --> show files in size order

ps -ef --> show running processes list

pkill -9 <process name> --> kill a hung process

bb --> sick ASCII demo

mech@feddit.org on 28 Nov 22:51 collapse

ls -ahl --> show files (including hidden ones) with sizes in human-readable format

melsaskca@lemmy.ca on 28 Nov 13:39 collapse

ping. I wrote a program to go through all sets of IP4 numbers and recorded to a flat file whenever I’d get a successful ping. From that list I was able to determine…then I got bored and moved on to something else.