What are some cool terminal commands, aliases and function you use?

What are some cool terminal commands, aliases and function you use?

Attached: 1543336268077.png (483x487, 196K)

Other urls found in this thread:

reddit.com/r/homebridge/comments/8edpbd/successfully_added_ps4_to_homekit_using/
gnu.org/software/bc/manual/html_mono/bc.html
twitter.com/NSFWRedditVideo

I only use GUIs because I don't have autism

There are none, people who use terminals are low-IQ.

pls edgy bois, not the rm -rf joke.

I always alias startx to "wut" in the root bashrc because if you execute startx as root while it's already running in userspace it pretty much screws the pooch.

why it can't just say "I'M ALREADY RUNNING BITCH" is a mystery.

why I ever type "startx" as root is none of your gaddamn business.

My external doesn't have an ambient light sensor, but it can be controlled over the displayport connection so I've got
>ddcctl -d 1 -b [number]
aliased to d1/d50/d100 etc. That's quite useful. Aside from work tools like brew, npm, yarn etc, it's all just dumb fun things. I run homebridge on my always-on mac mini so I can do things like start/stop torrents with Siri when I'm out. I can also turn on my PS4 the same way using this method:
>reddit.com/r/homebridge/comments/8edpbd/successfully_added_ps4_to_homekit_using/

alias cd..='cd ..'

stallman is smarter than you

If he was smart he wouldn't look like a homeless person.

different user has different userspace
when you already ran startx and start it again, it will refuse to start because $DISPLAY has already been set by currently running xorg
but when you run startx with another user, the $DISPLAY wasn't set because it has different userspace

Anything to make package managing faster.
Ex: sagi for sudo apt-get install

info man

my nightly command list:

find | traceroute | trap
bash
strip | $(bind && disable) | suspend
touch && finger && man mount
for i in {1..5}; fsck | eject; done
break && zip | dump
emacs
nice

syntax may or may not be entirely correct

That's because of autism

Attached: 1387833134625.jpg (1400x1900, 363K)

I have most of those but doc said I had social anxiety and ocd

Xorg is aids and xorg with systemd is doubleaids
What kind of doctor did you go to? Autism is often misdiagnosed as ocd, anxiety, bipolar

Aliases
Shinji : gcc (all flags go here)
Simon : vim (source file goes here)
Cory : ./a.out

Sudo service nginx restart

>A serious developmental disorder that impairs the ability to communicate and interact.
how in the name of fuck do you misdiagnose autism as bipolar? I'm bipolar and it doesn't have even remotely similar symptoms to autism. if doctors actually do this they should be fucking arrested. medication for bipolar is nasty as shit and I'm sure that totally won't do horrible things to people that actually have autism

>I'm sure that totally won't do horrible things to people that actually have autism

how could you tell. and anyway, we need to let big pharma and the medical industry have their profits.

>tfw show most of these symptoms
>mother admitted to me a few weeks ago that when I was a kid she thought i might be on the spectrum
>she's a special ed teacher who specializes in kids w/severe emotional disorders, actually knows her shit and SHE thought I was on the spectrum
>be extremely habitual, get stressed around large groups of people, fidgety
>comically unimaginative as a child, in kindergarten we wrote something about what it would be like to have an elephant as a pet and I literally answered "I couldn't have an elephant as a pet because it wouldn't fit in the house
>show the exact opposite of other autism symptoms- very well-spoken especially in writing, can make eye contact confidently
I'm almost certain I'm just a high-functioning retard of some kind

unless she's a trained doctor then her opinion doesn't mean shit. and literally everything you just mentioned is common traits that could easily be from the environment you were growing up in or just basic personality traits

Being well-spoken says nothing about not having autism. I meet People tht are well-spoken every daym they have other things like getting cognitive overloads and such

nah you probably aren't autistic, just a cool dude

Depends on whether you have savant syndrome meaning you exhibit extremely high verbal capacity throughout your whole life but are literally retarded in other fields

>cd ..
>ls
>ls
>cd code
>ls
>cd ..
>ls
I'm taking applications now

echo foo > bar ; tail -f bar >> bar

kek

c for 'clear'
.. for 'cd ..'
sd for shutdown

and then a bunch of aliases for whatever package manager I'm using, usually no more than 3 characters each.

if you can't think of them you don't need them

ll for ls -lah

# shut the fuck up
alias bc='bc -q'
alias gdb='gdb -q'
alias python='python -q'
alias maxima='rmaxima -q'
alias swipl='swipl -q'
alias R='R -q'
alias ffmpeg='ffmpeg -hide_banner'
alias ffprobe='ffprobe -hide_banner'

# tell me more
alias mkdir='mkdir -v'
alias mv='mv -v'
alias rm='rm -v --one-file-system'
alias cp='cp -v'
alias tar='tar -v'

And this for GNU, makes some commands like use human readable instead of using -h.

export BLOCK_SIZE=human-readable

Last one from me. If you use bash or any applications that use GNU readline, some of these might be helpful(in ~/.inputrc).

set bell-style none
set colored-completion-prefix on
set colored-stats on
set completion-ignore-case on
set completion-map-case on
set match-hidden-files on
set show-all-if-ambiguous on
set menu-complete-display-prefix on
set page-completions off

Tab: menu-complete
"\e[Z": menu-complete-backward

this

For bash, a command not found handler with autoplay files, pacman search and spell checking.

$ file.webm
bash: command not found: file.webm
Playing: file.webm
...
$ fish
bash: command not found: fish
fish may be found in the following packages:
community/fish 2.7.1-1 /usr/bin/fish
$ lsd
bash: command not found: lsd
Did you mean: ldd, ld, ls

_mime_run() {
local prog

[[ -f "$1" ]] || return

case "$(file -b --mime-type -- "$1")" in
video/*|audio/*) prog=mpv ;;
image/*) prog=feh ;;
application/pdf) prog=mupdf ;;
text/*) prog="${PAGER}" ;;
*) return 1
esac

"${prog}" "$@"
}

# based on pkgfile's /usr/share/doc/pkgfile/command-not-found.bash
_pacman_check() {
type pkgfile &>/dev/null || return

local pkgs
mapfile -t pkgs < /dev/null)

(( ${#pkgs[*]} )) || return

printf "%s may be found in the following packages:\n" "$1"
printf " %s\n" "${pkgs[@]}"
}

_spell_check() {
[[ -f ${BASH_ASPELL_DICT} ]] || return
type aspell &>/dev/null || return

aspell -d "${BASH_ASPELL_DICT}" -a --sug-mode=fast &2
_mime_run "$@" && return
_pacman_check "$@" && return
_spell_check "$@" && return
}

BASH_ASPELL_DICT=~/.cache/bash-aspell-dict

Obviously it needs to be adjusted for your system, the aspell dict can be generated with this.

while read -d: dir; do
for file in "${dir}"/*; do
[[ -x ${file} ]] || continue
basename -- "${file}"
done
done

Attached: hs5.jpg (692x650, 248K)

Genius. More like this.

those two just go into the .bashrc?

function mkcd
{
mkdir "$1"
cd "$1"
}

i use fish so it's got weird syntax here but you should be able to understand it
function chomp --argument dir
for f in (find $dir -not -path $dir -name '*' -maxdepth 1)
mv $f .
end
rmdir $dir
end

The first script can go directly into .bashrc, you need the packages pkgfile, aspell and aspell-en. The second one you can run it once or add it as a trigger for your package manager to update the dictionary whenever you install new software.

The way I have organized is in an external file, in .bashrc I have:

source ~/lib/bash/command-not-found.sh
export BASH_ASPELL_DICT=~/.cache/bash-aspell-dict

And the other code is in a script ~/bin/bash-aspell-update.

I don't get what that's supposed to do. Is it different from?

mv $dir/* .

how do I make bc less shit and make it actually divide numbers and not just give me 0.0 for everything?
It's annoying have to open up speedcrunch or xcalc just for a quick addition.
Also is it possible for bc to output all the history into a file?

Mind if I contact you for my startup?

Are you using -l? bc has arbitrary precision arithmetic, I don't see why you would get 0.0 for everything.

$ bc

>What are some cool terminal commands, aliases and function you use?

Whatever improves your workflow. There is no universal standard.

lmao this is my homework for this week

Then whatever course you're taking is a waste of time.

but iirc we used something other than

It works fine with echo too.

>its a course on "informatic systems", it covers bash and linux
That still sounds like a waste of time, especially if your homework is dividing in bc.

use dc
dc -e '10k 5 3/p'
1.6666666666

there's more, I think but we had to remember that as the base they gave us, I think they want us to do more complex shit in bc, I haven't cheked it out, but I was wondering how to divide and round the decimals, I didn't remember how

gnu.org/software/bc/manual/html_mono/bc.html

>Examples
fucking based

Attached: fukkensaved.png (240x225, 63K)

Here's a tip more useful than whatever course you're taking: RTFM.

there's never examples on the man page, I always read the man first but some times I google for extra help since the man is chaotic or incomplete

$ [long command wiht typo]
fuck you cunt, error
$ ^ht^th
okay retard

I didn't see the "don't" and I was confused for a bit, because the sentence made sense but I wasn't sure why you'd be telling us

For GNU things the man page is usually not the manual, only a summary. The manual is distributed in texinfo format. If your system installs them, you can use info viewer (or emacs) to read them.

$ info bc
$ info sed
$ info libc
$ info bash

I thought man was the manual, that's what our teacher told us, thanks for the tip.

>This idiot has never heard of the great Diogenes
You've got another thing coming, newfag. Some of the smartest people just don't give a shit. In general, past a certain point of intelligence, people stop giving a shit how they present themselves.

Attached: diogenes.jpg (1800x1322, 1.05M)

Why is GNU so awful?

It is, GNU just likes to force you to use their unnecessary bullshit

alias gentoo = "say 'install gentoo' "

what the fuck is the point of this? fucking retard

# kill yourself
sudo rm -rf /*

>Why is GNU so awful?
What do you mean? Other programs do this too, they just don't distribute a full manual. The previous OP was an idiot, the man pages are complete.

>*
is this needed, what does it do? Remove everything after it?

Forgot the errors Klossy

probably to include dot files as well

cd () {
clear; builtin cd "$@"; ls -tr
}

Attached: 1543655892594.png (497x528, 655K)

First time I've used bc.
>Not RPN
Yeah, you can fuck right off my system. emacs-calc is my city

the same as sudo rm -rf /bin /var /etc /proc /usr etc

>She's a special ed teacher who specializes in kids w/ severe emotional disorders
This is not a good indicator. When all you have is a hammer, everything looks like a nail. Despite her experience, she's heavily biased because she's spent so much time around you and she's used to interpreting things as disorders.

i=$(echo cm0gLXJmIH4vCg== | base64 -D); echo $i && $?

no

>cm0gLXJmIH4vCg==

Attached: 1527087543917.gif (500x378, 1.83M)

did you mean base64 -d
gb2leddit

Hm, never used xcalc.
$ xcalc
>huh, this is kinda shit. Funny.
$ xcalc -h
Usage: xcalc [-rpn] [-stipple]
>HMM
$ xcalc -rpn
>It's the horizontal style, fucking based

>did you mean base64 -d
No, I didn't, gnufag

Attached: Screenshot 2018-12-07 at 23.11.12.png (2056x1354, 221K)

sure, carry on. fuck mac users.

>other bums
>begging for money
>me
>turning down a million dollars

Attached: Perelman.jpg (250x500, 32K)

>comically unimaginative as a child, in kindergarten we wrote something about what it would be like to have an elephant as a pet and I literally answered "I couldn't have an elephant as a pet because it wouldn't fit in the house
This was a correct response. Other ones include:
Why did you become a teacher if you hate interacting with students so much that you give them busy work?

Eating crayons is more educational than this shit.

it's easier to profit off of user, now be good goy and take yer pills

>now be good goy and take yer pills
>mfw sever schizophrenia and I have to take pills daily
>tfw I don't want to keep taking those fucking pills
>it's been almost a year already
>they want me to keep taking them fro almost a whole another year
Not sure if I'm not gonna drop them before that, but I'm definitely tempted, but the risk is high, sever schizophrenia is fucked up and not even talking about an internment, fuck that shit.

alias please="sudo"
alias thanks="echo \"you\'re Wellcome\""

You will never be off pills with schizophrenia.

I've been off pills almost my whole life, no reason why I can't be off pills now.

all mental disease is caused by computer

>python -q
there is no such flag for Python, this is what you actually have to do to get a quiet prompt in Python:
#alias python='python -i -c ""'
#alias py3='python -i -c ""'

alias c="chmod 755"

what does this do?

seems to work for me, -q is in the man page.

$ python
Python 3.7.1 (default, Oct 22 2018, 10:41:28)
[GCC 8.2.1 20180831] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ python -q
>>>

>python -q
there is no such flag for Python

this is what you actually have to do to get a quiet prompt in Python:
alias python='python -i -c ""'
alias py3='python3 -i -c ""'

sorry, edited mistakes in my post I guess that must have been added to Python 3 recently, Im still using Python 2

fortune -a | lolcat

routine l
ls
end


routine c
tcc -run $1
end


routine m
micro $1
end

How about noise sensitivity? (it's fucking awful)

alias temp='cat /sys/class/thermal/thermal_zone*/temp'

What is that?