MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/shittyprogramming/comments/gdl3a7/sudo_shutdown_h_now_to_optimize/
r/shittyprogramming • u/ajx_711 • May 04 '20
40 comments sorted by
14
It gets rid of compiler errors, too!
8 u/Hegdahl May 05 '20 And reduces executable size
8
And reduces executable size
9
What does -h do?
18 u/Nawordar May 05 '20 Shows help of course! 7 u/thirdegree May 05 '20 manpage says-h Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.I'm just not sure what the difference there is. 9 u/portugueasey May 05 '20 Does the halt option have to do with old AT standard PCs, where you had to manually switch off the power? I’m probably completely wrong 5 u/Nawordar May 05 '20 My manpage says -h Equivalent to --poweroff, unless --halt is specified. So… what does it change when --halt is specified? ¯_(ツ)_/¯ 2 u/thirdegree May 05 '20 Different distro I guess? Not gonna lie I just googled 'man shutdown' because lazy. -1 u/Yoghurt42 May 05 '20 Then it’s equivalent to rm -rf / 1 u/dstarlc May 05 '20 You need to specify either -r (reboot) or -h IIRC. 1 u/zacym May 05 '20 On my Mac,shutdown -h time-h The system is halted at the specified time.Time is the time at which shutdown will bring the system down andmay be the word now (indicating an immediate shutdown) or specifya future time in one of two formats: +number, or yymmddhhmm,where the year, month, and day may be defaulted to the currentsystem values. The first form brings the system down in numberminutes and the second at the absolute time specified.
18
Shows help of course!
7 u/thirdegree May 05 '20 manpage says-h Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.I'm just not sure what the difference there is. 9 u/portugueasey May 05 '20 Does the halt option have to do with old AT standard PCs, where you had to manually switch off the power? I’m probably completely wrong 5 u/Nawordar May 05 '20 My manpage says -h Equivalent to --poweroff, unless --halt is specified. So… what does it change when --halt is specified? ¯_(ツ)_/¯ 2 u/thirdegree May 05 '20 Different distro I guess? Not gonna lie I just googled 'man shutdown' because lazy. -1 u/Yoghurt42 May 05 '20 Then it’s equivalent to rm -rf / 1 u/dstarlc May 05 '20 You need to specify either -r (reboot) or -h IIRC.
7
manpage says
-h Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.
I'm just not sure what the difference there is.
9 u/portugueasey May 05 '20 Does the halt option have to do with old AT standard PCs, where you had to manually switch off the power? I’m probably completely wrong 5 u/Nawordar May 05 '20 My manpage says -h Equivalent to --poweroff, unless --halt is specified. So… what does it change when --halt is specified? ¯_(ツ)_/¯ 2 u/thirdegree May 05 '20 Different distro I guess? Not gonna lie I just googled 'man shutdown' because lazy. -1 u/Yoghurt42 May 05 '20 Then it’s equivalent to rm -rf / 1 u/dstarlc May 05 '20 You need to specify either -r (reboot) or -h IIRC.
Does the halt option have to do with old AT standard PCs, where you had to manually switch off the power? I’m probably completely wrong
5
My manpage says
-h Equivalent to --poweroff, unless --halt is specified.
So… what does it change when --halt is specified? ¯_(ツ)_/¯
--halt
2 u/thirdegree May 05 '20 Different distro I guess? Not gonna lie I just googled 'man shutdown' because lazy. -1 u/Yoghurt42 May 05 '20 Then it’s equivalent to rm -rf /
2
Different distro I guess? Not gonna lie I just googled 'man shutdown' because lazy.
-1
Then it’s equivalent to rm -rf /
1
You need to specify either -r (reboot) or -h IIRC.
On my Mac,
shutdown -h time
-h The system is halted at the specified time.Time is the time at which shutdown will bring the system down andmay be the word now (indicating an immediate shutdown) or specifya future time in one of two formats: +number, or yymmddhhmm,where the year, month, and day may be defaulted to the currentsystem values. The first form brings the system down in numberminutes and the second at the absolute time specified.
-h The system is halted at the specified time.
Time is the time at which shutdown will bring the system down and
may be the word now (indicating an immediate shutdown) or specify
a future time in one of two formats: +number, or yymmddhhmm,
where the year, month, and day may be defaulted to the current
system values. The first form brings the system down in number
minutes and the second at the absolute time specified.
4
Sometimes it’s hash
Not pound
1 u/[deleted] May 05 '20 o c t o t h o r p e 2 u/CarpetPedals May 05 '20 holy interrobang
o c t o t h o r p e
2 u/CarpetPedals May 05 '20 holy interrobang
holy interrobang
sudo shutdown -h now to optimize
Pro Tip: execute this right after you've weitten the entire code and before Ctrl+s
Equivalent to shutdown /p on windows.
shutdown /p
r/technicallythetruth
To save time on typing just wrap all the code in
/*
*/
Technically it isn't wrong.
If the CPU doesn't have to execute any instructions, then your program will be faster. Granted, your software won't function, or your compiler might complain, but something for something.
TIL Prepend is a word and if i had to guess what it means its probably the opposite of append.
14
u/republitard_2 May 05 '20
It gets rid of compiler errors, too!
9
u/thirdegree May 05 '20
What does -h do?
4
u/CarpetPedals May 05 '20
Sometimes it’s hash
Not pound
hash
4
u/abdulsamadz May 05 '20
Pro Tip: execute this right after you've weitten the entire code and before Ctrl+s
2
u/Jonno_FTW May 05 '20
Equivalent to
shutdown /pon windows.2
u/[deleted] May 05 '20
r/technicallythetruth
2
u/[deleted] May 05 '20
To save time on typing just wrap all the code in
/*
*/
1
u/ZILtoid1991 May 14 '20
Technically it isn't wrong.
If the CPU doesn't have to execute any instructions, then your program will be faster. Granted, your software won't function, or your compiler might complain, but something for something.
1
u/Wralth_ Jul 07 '20
TIL Prepend is a word and if i had to guess what it means its probably the opposite of append.