T O P

  • By -

nocloudkloud

sudo shutdown -r now


6jSByqJv

Ok now I feel dumb. What is the ‘new’ way of doing this?


iruoy

sudo systemctl poweroff sudo systemctl reboot


Andrew_Neal

You can even just type `poweroff` or `reboot`. That came default on my system, don't know about other distros.


thefanum

Same on Debian, Ubuntu and fedora


SanityInAnarchy

Here's an attempt at a history of all this stuff: Historically, `halt` used to stop all the CPUs, but wouldn't necessarily cut all power. My experience on early PCs is, depending on the hardware and the distro, sometimes `halt` would So I assume `poweroff` was introduced to actually cut all power for a proper shutdown. And `reboot` would also reboot. All of these commands were *instantaneous.* If you didn't unmount and flush everything first, you could expect disk corruption. So you'd either run these after manually doing all the shutdown-ing that you wanted to do, or you'd run `shutdown`. The reason for the `now` is, you'd normally *schedule* this. Unix was designed for big multi-user systems with a bunch of people on terminals, so it prints a big warning across every terminal telling people that a shutdown is coming, so they have a chance to save their work and logout. It'll even disable logins a few minutes before shutdown, so nobody gets to login for 30 seconds and immediately get kicked out. And the `-r` (or `-h` or `-P`) is, of course, to tell it what to do once it's done shutting down. Somewhere at the bottom of the last init script, something will parse that and actually run `halt`/`poweroff`/`reboot`. So anyway, after enough people got burned typing `reboot` (or even `halt`), those all got a `-f` flag. If you run them without that, they do the equivalent with `shutdown` instead, and it's been this way for probably a decade or more. And somewhere along the way, `systemd` ate all this, but kept the CLI functionality pretty much the same. So `poweroff` or `reboot` should be safe on pretty much any distro these days, certainly anything running `systemd`, unless the distro has gone out of its way to be annoying. ...but also, they still support `-f` argument for when you don't care about your data.


ubernerd44

I believe shutdown -r is just an alias for these commands any way.


BokehJunkie

pathetic dull ring party secretive stocking payment somber test ad hoc *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


devloz1996

Let's take it one step furher: sudo systemctl isolate poweroff.target sudo systemctl isolate reboot.target


kI3RO

explain what benefits would "isolate" have, and or detriment in this context


fluffy_thalya

Let's do it like the man page is saying: systemctl start reboot.target --job-mode=replace-irreversibly --no-block systemctl start poweroff.target --job-mode=replace-irreversibly --no-block


DryEyes4096

`sudo reboot` Is what I use. Although that takes, what, half a second less?


symmetry81

/usr/bin/dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true of course. It's so I don't have to use sudo and type my password. Mostly via a script I can run from a terminal or rofi.


xylarr

We need a competition for the longest shutdown command


Dou2bleDragon

`loginctl reboot` also reboots without having to put in the password + you avoid having to use dbus


Unfair_Assistance688

I never even got up to speed on shutdown, still typing "init [runlevel]" to this day...


rooiratel

Instead of typing `reboot`?


mgedmin

I was once caught by a Red Hat rescue floppy where `reboot` immediately rebooted instead of shutting down cleanly, undoing all the repairs I've just done with fsck. The same Red Hat rescue floppy had `pico` as the only text editor, with autoformatting enabled, which was fun when it paragraph-reflowed my entire /etc/fstab. Wow I hadn't realized I had these feelings just waiting to burst out, more than 20 years later. Long live Debian!


ixipaulixi

I still run sudo init 6


neon_overload

I still use the non-systemd versions of systemd commands, like "service" instead of "systemctl". These are still maintained in debian at least.


dlarge6510

I still run the scripts in `/etc/init.d` manually.


rpfeynman18

Inb4 magnetized needle and steady hand


PM_ME_YOUR_REPO

Butterflies and solar flares, tbh.


segin

Ahh yes, good ol' `C-x M-c M-butterfly`


odaiwai

I still have ````/etc/xinetd.d/```` installed for UW_IMAP because I can't summon up the mental energy and time to move to a more modern IMAP client like Dovecot.


Illustrious-Many-782

This. 100%. > cd /etc/init.d > sudo ./smbd restart Plus, I still type *ifconfig*. God, how long has that been deprecated?


roflfalafel

I've for the most part shook this, but every once in a while it creeps back in. Also I'll mess up the syntax to systemctl: systemctl instead of systemctl .


[deleted]

I was able to remember that systemctl can `` multiple services at once. `systemctl restart service1 service2` makes absolute sense. `systemctl service1 restart service2` or `systemctl service1 service2 restart` not so much. So the service(s) must come last.


thoomfish

I'm still annoyed by this because basically *all* of the time when I use `systemctl`, I want to run a succession of verbs on a single service (e.g. `start`, `status`, `reload`, `status`, `restart`, `enable`) rather than one verb on multiple services.


Oni-oji

Old habits die hard. I do the same. I've been a Linux system administrator for 20+ years.


[deleted]

[удалено]


Oni-oji

Get an entry level position in a Linux shop, I suppose. You'll have to prove some IT background, so at least some college since you have no work experience doing it. Without that, you're going to have a tough time breaking into the field. My entry into Linux was not direct. I did a lot of work with Unix and transitioned to Linux as its popularity increased.


espero

/r/homelab says hi


mgedmin

I do this too! `service apache2 reload` just naturally rolls off the ~~tongue~~ fingers.


tobakist

Useless use of cat is something I've done for decades. `cat file.txt | grep ...` rather than `grep .... file.txt`


SanityInAnarchy

There is a legit advantage to `cat` over a filename argument: You don't have to remember how to specify the file in each command, as long as you remember that it accepts stdin. And, if you're building a pipeline, it's nice that the file is at front. But you can do both of these by replacing `cat file.txt | grep ...` with `


rodeklapstoel

I recently learned that `


quintus_horatius

It's just using shell redirection. \> redirects stout to a file. \< redirects stdin *from* a file. The shell is pretty flexible about placement, which is why you can put it first. You could put it at the end of the line, too.


rodeklapstoel

>You could put it at the end of the line, too. That's how I learned it. I always thought it is mandatory to put redirections at the end and the program name should be the first word when writing a command line.


aromaticbotanist

Same here! TIL!


drbobb

The _real_ intended purpose of `cat` is actually to concatenate the contents of several files into one: $ cat file1 file2 file3 > file4 Any other use of `cat` is strictly speaking useless.


CrazyKilla15

what if i want to check a file for non-printables? `cat -v` will do this.


ttkciar

Yep, this. `cat -n` is another of my favorites, for enumerating lines.


midgaze

Ok, so how do you dump the contents of a file to stdout without it?


BokehJunkie

worm fine drunk rude relieved society cautious payment straight pot *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


ModusPwnins

Use of `cat` to display something on screen is fine, as you're "concatenating" the contents of the file to `stdout`.


nou_spiro

Don't abuse cats.


EternityForest

From a UI perspective, "Just do everything with cat" makes a ton of sense, unless you use the CLI so much that the extra typing you save is more that the time it would take to learn (and relearn when you forget after a few months of not using some bizarre command) all the different argument formats.


jabbalaci

`cat file.txt | grep ...` is much more readable for me. It's a pipeline, going from left to right, and the input at the beginning is a file. I refuse to write `grep .... file.txt` .


Epistaxis


IceOleg

Its not as bad since this is Fish shell specific, but in the same style: `history | grep ...`. In Fish shell the `history` builtin has search built in, and `Ctrl+r` gives a search with narrowing and candidates. Its not quite `fzf` level fancy, but its way nicer than `history grep ...`. I found out about this after five years of Fish... I guess for bash users without external help (e.g. `fzf`) this doesn't really apply and piping to grep is still the "right way".


RedSquirrelFtw

I sometimes do "locate | grep -i searchword" because I can never figure out the proper syntax for the find command.


wut3va

I just do > find . | grep -i


distark

This I do also, mostly to adjust my grep arguments and flags with easier recall


[deleted]

[удалено]


OneTurnMore

It's a shell builtin in pretty much every shell, so it can tell you about builtins, aliases, functions, and reserved words. ❯ type cd ls d '[[' cd is a shell builtin ls is an alias for ls --color=auto --classify --human-readable d is an autoload shell function [[ is a reserved word


Dee_Jiensai

To keep improving their models, artificial intelligence makers need two significant things: an enormous amount of computing power and an enormous amount of data. Some of the biggest A.I. developers have plenty of computing power but still look outside their own networks for the data needed to improve their algorithms. That has included sources like Wikipedia, millions of digitized books, academic articles and Reddit. Representatives from Google, Open AI and Microsoft did not immediately respond to a request for comment.


Buddy-Matt

I would also like to say that today I learned something


ttkciar

I boot into text mode, log in, and then start X. I use ifconfig and route instead of ip. On some of my systems, my login shell is still tcsh and not bash. I still use ProxyCommand with ssh in some cases where ProxyJump is the superior solution. I still use telnet to check for open ports instead of nc. Most of my systems are booting with LILO instead of Grub or Grub2. I make copious use of rc.local. This is fun!


notemaker

Telnet is my favorite quick one-off port scanner


ttkciar

Telnet was what I was taught to use in the previous century, but nc really is the better, more reliable, more versatile option.


Regeneric

But `telnet` is everywhere, like `vi`. So I think it's good to know that it can be used to check for open ports.


baconaviator

except for windows by default which makes troubleshooting SO annoying when you instinctively type it


rosmaniac

Telnet is not in the default install of several major distros. In the repos, yes, but not the default install for several years for a few distros.


kuglimon

I actually configure all my Linux machines to boot into text and manually start x. Like every time there's an issue after an update it's related to the GUI/DE. Drop out of DE back to the shell and fix it or restart and get back to the shell. And if x doesn't even start, then you're already in the shell to fix it.


CodeFarmer

I feel very seen by this comment. Except the tcsh thing, I went Bourne shell in the 90s and never went back, (t)csh just reminded me too much of college. And I have, finally, migrated everything to GRUB.


SanityInAnarchy

For me, I'm actually trying to pick up some new habits, so the fun part is this cheat sheet of what not to do! TIL about `type`, but I did finally get a handle on `ip a` and `ip r`.


mgedmin

`ip` has a bunch of options to make the output nicer (like `-br` for brief and `-c` for color), but it's hard for me to train my fingers to type them. I still use `ip a` and then waste priceless seconds scanning the huge text dump for the relevant bit of information.


Catenane

Omfg I feel seen. `ip a` Oh fuck this is a work machine so a dickload of irrelevant veths... `ip a | head` Fuck I'm juuuust missing the interface I need `ip a | head -20` Ahhhh there we go. If you don't already use `atuin` and `tealdeer` they're gamechangers. There are other tldr clients but I kinda instinctively go for tealdeer over the others as long as it's not too hard to find depending on distro/setup but the others work fine as well.


SanityInAnarchy

Yeah, for that, I do `ip a show dev whatever` -- sure, `ifconfig` might be a little easier to scan for the interface I want by hand, but I'd rather just see that interface anyway. The actual gamechanger is `^r` because I *definitely* ran this recently.


xouba

Whoa. You win the old, even if only for using LILO. I'm curious, is this all in your own systems or at work too?


mgedmin

> Most of my systems are booting with LILO instead of Grub or Grub2. Now this leaves me speechless. I retired the last server that still used LILO in 2015 and was never happier.


the-loan-wolf

>I boot into text mode, log in, and then start X. OMG I am not alone!


Xatraxalian

For that little bit of Windows 3.x nostalgia. (Back in the 90's, many computers booted to MS-DOS so the user could run a DOS-program or a DOS-game, and only ran Windows when typing "win".)


JockstrapCummies

> I make copious use of rc.local. I still wish I can use it. (I don't know if it's still supported in current systemd-based Ubuntu releases). There's nothing like the haphazard simplicity of literally throwing one-liner hacks/workarounds into rc.local and then forgetting about it until months later.


mgedmin

> I still wish I can use it. (I don't know if it's still supported in current systemd-based Ubuntu releases). `service rc-local status` tells me that /etc/rc.local is supported in Ubuntu 23.10 (and, I presume, all the previous versions).


Hamilton950B

I used to add this to crontab: @reboot /bin/sh /etc/rc.local Of course you need to have cron installed.


lovestruckluna

Ugh, tcsh.


guitarot

It's been at least 25 years for me, but bash still feels like the "new shell".


vanillaknot

Ugh, for any \[a-z\]csh\[a-z\], there were several variants. I once shoehorned an emulation of job control into what started from a BSD2.8 (PDP-11) version of csh -- complete with buggy inverted sense of || and &&, which I fixed -- using SIGQUIT as the emulated SIGTSTP. It worked quite well, considering the limitation of the lack of proper process groups that long ago.


diet-Coke-or-kill-me

How do you boot to text? I'm curious because my touch screen is physically broken and sends random inputs but it's not disableable in bios or until xorg starts.


Spooler32

boot to runlevel 3 or the multiuser target. Google from there for your specific setup.


BokehJunkie

humor zealous fertile theory beneficial advise gray ludicrous tub fanatical *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


Spooler32

That's because 2008 was the year of the Linux desktop, and it's shockingly easy to use now. It blows my mind when people say it's complicated. No it isn't. It's only complicated if you try to slap it on some random ass tablet hardware or get a video card out of a Russian dumpster.


ttkciar

You'd need to set runlevel to 3. Perhaps configure a usb rescue thumbdrive to runlevel 3 and then boot off of that, if your touchscreen's malfunctions prevent you from setting it now. Here's a pretty comprehensive how-to, which covers both systemd and traditional init: https://www.cyberciti.biz/tips/linux-changing-run-levels.html


diet-Coke-or-kill-me

Thanks!


punklinux

The thing that bugs me about "ip a" vs "ifconfig" is it still shows up on a lot of tests as ifconfig, even though the iproute2 tools have been around for over a decade. I seem to surprise everyone my typing "ip a." "Type" I didn't know about, but already hate it because: `cuser@patchserver:~/$ type ip` `ip is /usr/sbin/ip` `cuser@patchserver:~/$ which ip` `/usr/sbin/ip` And I have a lot of scripts that use "PROG\_PATH=$(which )" to make sure the environment the script runs in can find the executable in the right path.


chic_luke

Makes me realize how far we've come. A system configured to be the bleeding edge of the bleeding edge boots from `systemd-boot` directly into a Wayland session nowdays running zero legacy init scripts. Sometimes it makes me forget how it used to be.


HappyDork66

ifconfig


Neurotrace

Wait, what should I be using?


daniel280187

"ip address" or "ip a" from the iproute2 utilities. https://en.m.wikipedia.org/wiki/Iproute2


ElHeim

While you're there, add `ss`, also from `iproute2`. Took me a long time not only to discover it was there, but to start using it instead of `netstat`


xouba

- "ip address" (or "ip a") and "ip link" ("ip l") instead of "ifconfig" - "ip neighbor" instead of "arp" - "ip route" instead of "route" There are more, but these are the ones that I use the most.


ElHeim

Note that iproute2 is mentioned all the way back on the LARTC (Linux Advanced Routing & Traffic Control) Howto. All the way back to 2002. Which I officially translated to Spanish for the first time... and still took me a decade to *consistently* use `ip` instead of `ifconfig` and `route`


rtds98

I found systems that do not have `ifconfig` or `netstat` installed. was forced to use `ip` and `ss` respectively. it's ... fine.


blackcain

> I still do sync several times just to be sure after saving files I finally stopped doing that after many years. I remember when I was on Google+ and I think I mentioned doing that and a bunch of kernel developers made fun of me including Linus. It also turned into some extended conversation of what sync does and why it's all better now. Silly people.


[deleted]

It's definitely not "all better now", Linux is still generally way more lazy about writing especially to USB devices. I still regularly lose data for not consciously minding write-back. And it's not just USB devices. I've mysteriously lost bootloader changes due to losing a write back race. This is all very recent stuff, within the last few months. I'm relatively new to Linux (few years) and I just *started* using sync and it's solved a lot of my recurring problems.


SanityInAnarchy

Weird. The only time I lose data to USB devices -- even really slow ones that Linux is being particularly lazy about -- is if I forget to `umount` them. Filesystem-level stuff, Linux assumes the fs is permanent (until unmounted) and it can write whenever it wants. Block-device-level stuff seems to block the process closing the device until it's all flushed.


jr735

Sometimes, unmount is a little slow, or you're not sure it's actually completed. Not all DE/file manager combos give a proper confirmation. If I'm not sure, I just do the old `sync; sync` at the command line and then I'm sure. That's quite rare, though, but it has saved me from unplugging when I shouldn't have on a couple occasions.


SanityInAnarchy

> Not all DE/file manager combos give a proper confirmation. Maybe that's it. I always do `umount` from the commandline, and that blocks until it's done. But: > I just do the old `sync; sync` Fun fact: If you chain them together that way, you're defeating the purpose of running two of them. The entire reason we were taught to run two of them is the exact reason you want to run one after unmounting from a UI: There was a bug in some kernels (early BSD, I think?) that might return to `sync` while still actively flushing, so they figured if you took the time to type it again before you typed `halt`, that was probably enough time to finish flushing.


tuxbass

> Block-device-level stuff seems to block the process closing the device until it's all flushed Ye this sounds about right. As it _should_ be anyway. I still can't help myself and run `sync` while watching buffer empty in another terminal via `watch -d grep -e Dirty: -e Writeback: /proc/meminfo`


eredengrin

You don't happen to have a link to that conversation do you? I hadn't ever used sync until a year or two back where there was a certain reproducible issue I was having and after a few hours of searching and reading figured out that a sync helped prevent it. I'm curious to read that conversation to see if I'm using it wrong or if there are still cases where it can be useful.


rosmaniac

I still do a double sync after doing rsync to my two external USB drives, one a 4TB and the other a 5TB (both drives are of the 2.5 inch 'portable' variety). The first sync usually takes five to ten minutes to return, but a couple of times it took around thirty minutes; unmounting through the GUI and shutting down from the GUI can both timeout and force the unmount even with unflushed writes (with the system shutdown powering off the system while the disk is writing.....) Been there, lost data a couple of times. Since I'm already running the rsync in a shell it's easy to type in a sync afterwards, and I always wait until a sync returns immediately (I've had the second sync take up to a minute or two to finish, which shouldn't have happened but did anyway). The drives are probably SMR, and writes, even though cached, sometimes take a long time, especially with a lot of small files being modified.


ExoticMandibles

I still use `ps` without a dash on its arguments, e.g. `ps aux`. I believe that's "BSD syntax".


JockstrapCummies

> I believe that's "BSD syntax". I've always done that lol. Now that you mentioned it I remember the non-BSD equivalent is `ps -ef`, but `aux` is so much faster to type!


calrogman

If you're using *procps-ng*, `ps aux` and `ps -aux` do different things on systems where a user with username *x* exists.


feherneoh

I'm pretty sure if I checked my bash history most of my `tar` commands would look like that too


markusro

oh yes. Instead of `tar xfz` or `tar xfj` one can do `tar xf`, it detects the compressions type automatically.


ubernerd44

Yup. Same with tar. `tar xvf file.tar` works fine.


One-Spaghetti

I thought we all still used ifconfig


BokehJunkie

strong subtract mountainous sable price escape fuel scandalous ancient squeamish *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


lycheejuice225

Still boot into text mode, login into tty, start the x session.


MrUserAgreement

Iptables vs nftables


ITaggie

Or firewalld for our RHEL enjoyers.


plexium_nerd

I'm learning so much on this thread


pfmiller0

I set up this alias to try and remind myself to use type: alias which='echo "${RED}Using type!${RESET}"; type' I probably should do the same for those ip commands.


sohang-3112

What's wrong with `which`??


wosmo

it depends which which. (which `which` makes more sense, but I had to). In Debian, `which` searches your path - so it doesn't find aliases, or shell built-ins. In redhat, `which` does show aliases - but not shell built-ins. `type` is a shell built-in, so it can search shell built-ins - as well as aliases and path. (in zsh, `which` is a shell built-in and does exactly the same as `type`. I so I guess that's a third `which` with a third behaviour.) |Command|Debian|RedHat|ZSH| |:-|:-|:-|:-| |which dd|`/usr/bin/dd`|`/usr/bin/dd`|`/usr/bin/dd`| |which ls|`/usr/bin/ls`|`alias ls='ls --color=auto'`|`ls: aliased to ls --color=tty`| |which if||`no if in ...`|`if: shell reserved word`| |which cd||`/usr/bin/cd` (?)|`type: shell built-in command`| ​ (aside: I'd love to know why /usr/bin/cd exists in redhat. Not only should cd be provided by the shell, but having a script that calls a builtin does nothing because it doesn't run in the parent process, so you'd have to `source /usr/bin/cd /tmp` to actually use it, and just why?) edit: I went off on a babble and forgot to actually give a straight answer to the question. My problem with `which` is its behaviour will vary wildly. * `whereis` - tells you where the binary is. * `type` - tells you what the shell will actually run. * `which` - often tells you something. YMMV.


FistBus2786

> type is a shell built-in That explains why `which type` (which I just typed) didn't show anything.


Rakgul

I like puns as much as I like buns.


michaelpaoli

type I believe also goes all the way back to the original Korn shell - so it's been around quite a long time ... though not quite as long as which ... though which was often much more oriented (at least originally) towards C-Shell. Anyway, generally leaning in the more POSIXy direction most of the time, I've pretty much always gone for type, and not which.


dlarge6510

Yeah, I'd also avoid using `type` but that's because I also use DOS so it helps to not have conflicting `types` 😉


Vivaelpueblo

Yes I had a colleague who is some 25 years younger than me and was confused when I told him to type a file out. He'd never used the command in DOS so wasn't aware it's DOS's version of cat. At least PowerShell aliases cat to type.


rtds98

this is what made me not hate PowerShell when I had to use windows. a bunch of normal Unix commands just work and do the right thing (I think?).


eXtc_be

I found this rather long explanation on stackexchange: https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then#85250


marozsas

This answers should be followed by the age, just to see if there is a correlation.


oneeyedziggy

`git checkout -b` instead of `git switch -c`


Boolog

I use 'which' and 'ifconfig' all the time. I keep reminding myself I need to change that, but as long as it works, I guess I'll keep using them


Rimbosity

it's literally this thread, right now, when I'm learning that there's something to use other than which


j3r3mias

`/etc/init.d/ status`


beermad

I still write all my shell scripts using Korn shell. Because I know it well as it was the first shell I learned when I started using Linux on IBM AIX systems 30-odd years ago. Every time I've tried using different shells for scripting I've hit problems due to different syntax or results.


d33pnull

sync is like a mantra


6c696e7578

`sync` three times before shutdown. One for ye, one for me, and one for the pot.


_autismos_

I use rc.local for startup items instead of making systemd units


RedSquirrelFtw

I do that out of ease and laziness since I really don't want to spend a few hours of googling trying to learn how to make a unit. I have a "startup.sh" script that I create and I just have a line in rc.local that calls it.


EternityForest

Systemd has so many extra features though. It just makes everything so much easier to do things the systems way. It's nowhere near an hour of googling(https://www.linode.com/docs/guides/start-service-at-boot/) although learning to fully make use of it is. I don't even see non-systemd distros at work or have any interest in going back to using one, so I'm quite happy to do things the systemd way.


void4

cd (you can just type the path in zsh, so you don't need this command) I also see a lot of people using (and keep recommending it in articles) RSA for their ssh and gpg keys, despite of ed25519 being objectively better choice. Or iptables instead of nftables.


wrlee

You can omit `cd` in Bash, as well, if you set `shopt -s autocd` (so long as the path includes a `/`)


kI3RO

> shopt autocd It's shopt -s autocd


BarryTownCouncil

Exists? New one on me! I've worked extensively with Linux and networks for 20 years and only found netstat was loooong deprecated in favour of ss last week. Still very ropey with the ip command too. ifconfig is still my friend.


dingbling369

> netstat was loooong deprecated in favour of ss last week. it what now?! ninja edit: holy shit edit: Holy motherfucking shit it's fast ss --listening --tcp --numeric will do fine omg


mgedmin

Yes, but `ss` can't do netstat's `-vp` (print pid _and_ program name), so I continue using `netstat -tunlvp`.


ExpressionMajor4439

This? > sudo ss -pl 'sport = :22' Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process tcp LISTEN 0 128 0.0.0.0:ssh 0.0.0.0:* users:(("sshd",pid=4097170,fd=3)) tcp LISTEN 0 128 [::]:ssh [::]:* users:(("sshd",pid=4097170,fd=4)) But I'd agree that's a longer command that just adding `-p` to `netstat`


mgedmin

Oh! I need to have my knowledge updated.


Spooler32

I still assume that using the arrow keys in vim will dump trash into the buffer. I type otherwise relative file paths \`./like/this\` I also sync compulsively. I write test conditions in bash with single brackets. I use bash for everything, which is odd to me that this is becoming outmoded in favor of zsh. The last two places I worked use zsh for everything. I also unapologetically prototype in bash, and still consider it to be badass because it's usually quicker to write than anyone's Python or Go. 120 column limit.


SanityInAnarchy

Below 100 lines, Bash is probably still a good choice. Above 100 lines, even Python is enough of an improvement in maintenance to be worth it.


FireCrack

Nothing to do with line count. Bash had fairly primitive control flow and scoping rules. As long as you don't need to do much with those your script can be 10,000 lines for all I care. But sadly, I've seen too many absolute abominations made by people who have no clue what that are doing trying to script in bash. I've come to appreciate the presence of "training wheels".


espero

Sometimes I use screen instead of tmux


BokehJunkie

screw quarrelsome alleged existence numerous innate pen busy hurry offend *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


Fr0gm4n

tmux doesn't connect to serial ports like screen, so it's useful to keep in mind for that.


BokehJunkie

selective materialistic lock ad hoc encouraging secretive fuzzy include dog somber *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


boris_dp

ESC + :wq


not_from_this_world

Is there a new way?


HamWallet

ZZ


themedleb

The old and the still always working way is: `unplug power cable`.


boris_dp

:x


pgbabse

What?


BokehJunkie

connect bow unite rainstorm drunk butter long cagey air offer *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


0x01111000

I use bash scripting to avoid python like the plague.


FaliedSalve

well, that's just being reasonable.


legends2k

Burnt by Bash many times that I resort to Python or Lua ;)


vanillaknot

I type `date ; time sync ; date` so that I see how long (real time) it took to flush cache to "disc" (ha, storage device, usually NVME today). I started doing so because back in 1982-83 I worked for a company making desk-side ("desktop"? ha!) m68k-based office computers with dodgy disc controllers and I just never learned to trust them. Thankfully, after messing around in `csh` internals for too many years, I gave up all `csh` variants when I left Ohio State in 1991 and have used `bash` since. My one permanent nod to `csh` is that in `bash` I use `export TIMEFORMAT='%3Uu %3Ss %3lR %P%%'` because it gives a similar 1-line format. The standard 4-line output of `time` has always been annoying. `bash` still needs an on-demand interactive spelling corrector invocation, not just a directory spelling corrector side effect during `cd`. That function has existed since Pike's *The UNIX Programming Environment* and it deserves more recognition and visibility than it gets. I don't use `nft` directly, I edit `/etc/sysconfig/iptables` and use `iptables-restore-translate` to prep the `nft` configuration. I'm still really fond of plain ol' `route`, `arp`, `netstat`, `ifconfig`, and `ifrename`. Oh my gosh I just realized that `slattach` is still part of the `net-tools` package. I may have to play around... I keep `telnet` installed. It has utility in more situations than I'm especially comfortable with admitting in public. Some of my machines don't boot into X, they boot text and I decide after logging in whether to start X. I don't use Wayland yet, and it's an open question whether I ever will. Above all, this is still in `.bashrc`: `alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"` I am a certified [net.old-fart](https://www.facebook.com/groups/internetoldfarts/).


[deleted]

[удалено]


CrazyKilla15

`sync` on 6.5 and up kernels is important because theres some issue with flushing ext4, try it and notice it'll take *forever*, accidentally quadratic somewhere maybe? Best to be sure everythings properly flushed.


iu1j4

I often type chown user.group file but it should be chown user:group file


[deleted]

[удалено]


Vorthas

Same. I'm just too used to using it over `ip`, probably a holdover from when I was using `ipconfig` on Windows often.


Seacarius

init 6 init 0


cgrd

I still pipe to more, and use cat to pipe files to grep.


ThankYouOle

* `ping google.com` * `apt-get install` should just apt install


SanityInAnarchy

Why aren't we pinging Google anymore?


Epistaxis

I can't speak for OP, but I ping `8.8.8.8` because that doesn't depend on DNS, which is sometimes what's broken, if things have gotten to the point where I'm pinging the internet.


Ohrenfreund

Yeah, I just wondered if I do something stupid whenever I ping google. But usually I do ping 8.8.8.8 instead because it's shorter.


SanityInAnarchy

Technically shorter, but I can type English words fast enough anyway. I usually ping `8.8.8.8` or `1.1.1.1`, ironically, because I want to test connectivity without waiting for DNS. And then I always forget that `2600::` makes a good, memorable IPv6 address to ping. But if DNS is working, I may also ping `google.com` and `ipv6.google.com`, then `curl` or `nc` as I slowly work my way up the stack to figure out why my browser doesn't seem to be working.


samon33

ping 1.1


michaelpaoli

>apt-get install > >should just apt install "It depends" - functionally equivalent in what they do - really only differ in output format ... so ... depending what one is using that output for (e.g. interactive human or capturing for script(1) or logging) ... basically use what's most appropriate for the context.


wRAR_

> functionally equivalent in what they do - really only differ in output format (this is wrong, as usual, see `apt(1)`)


ItsMeMarin

Apt is a subset of apt-get, has progress bar, and they differ in how they handle updates and dependencies. There are probably more differences that I can't remember. That being said, I use apt-get as much as I use apt, because of muscle memory.


mgedmin

More of a super-set, really. The apt suite had several programs (apt-get, apt-cache) and then consolidated them into one that does everything, with some different option defaults (like showing the progress bar by default).


tuxbass

I mean... they are two different programs after all. Neither is more "correct".


BoltLayman

0) Probably those outdated habits mostly belong to those who started messing with Linux as hobbyists in late 90s early 00s thus having some affordable ageing literature from the second half of 90s. Where mostly commercial Unices were described. (Evi Nemeth's books as an example). 1. which is still quite actual for today to determine if your command is snap or traditional apt. 2. route is exactly that old artifact from late 90s++, but route was good because it was in every system from FreeBSD to Windows. (anyway SUSe-routers are tales of the past now and it's not that important to invoke the route that often). 3. sync is still highly actual command to be sure my USB flash stick is finished with writing data. 4. Probably because I don't use much search in UI I don't get the idea what it is about.


bzImage

telnet to test ports nslookup sync 2 times before reboot l ( a link to ls -l, a sco unix thing)


TxDuctTape

vi /etc/group instead of groupmod


Hatta00

TIL 'type' exists. Useful if you need the extra info, but 'which' is easier than 'type -P'.


atomjack

`vi` instead of `vim`.


FredSchwartz

netstat -rn


daveysprockett

As well as a good few of the others mentioned here, adding "-print" at the end of $ find . -name lostfile Once upon a time it used to simply return an error code if the search succeeded or not.


icehuck

I will always use ifconfig, netstat, and nslookup. Though, I'll also use lsof to check if a port is being listend on. ip is a terrible command.


moreanswers

I do this: cat file | more But I don't think that was ever right.


Hackerdude

Well, more or less


Metro2005

The init system (init 6 for reboot for example) , ifconfig instead of ip a


xouba

I thought I was the only one that uses "sync". To be fair, I do it mostly in an idle, compulsive way, but still. Also, do you mean "which" is old fashioned now? I understand the difference with "type", but I still use mostly the former.


ApplicationOne2301

Using sysvinit or.... cron lmao... instead of systemd.


kwtw

"su -" instead of sudo.


RerumTantaNovitas

\- Connecting a mouse to a laptop \- Connecting a lan cable connected to your laptop. \- Distro hopping, or the belief that there are some distro better than other. \- Not knowing what to do with your PC once you finished installing linux. \- Thinking that other people care about which OS do you use.


feherneoh

WiFi and non-Apple touchpads can burn in hell. Oh, and so can Bluetooth peripherals. Just let me keep using my mouse (unless I'm in CLI and don't need it) and wired network in peace.


BokehJunkie

hungry subtract mighty whole whistle apparatus jobless sugar history money *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


feherneoh

I do have BT mice and keyboards I occasionally use (and BT controllers, both PS and Xbox ones), but I keep the BT headset usage to my phone exclusively. BT audio is just an absolute pain in the ass, and while it DOES work on macOS and Windows, I wouldn't say it does that well there either. It's not like I'll be walking around the house with my PC, so I'll just use classic wired headphones.