[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
Linux Masters of /g/ what Linux commands should everyone know?
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: 47
Thread images: 3
File: linux.png (80 KB, 1280x1024) Image search: [Google]
linux.png
80 KB, 1280x1024
Linux Masters of /g/

what Linux commands should everyone know?
>>
>>51971586
exit
>>
ssh -X [ip] to open remote GUIs
>>
rm -rf / --no-preserve-root
>>
troll
>>
( seq 1 8 200 ; seq 6 8 200 ) | sort -n | xargs -I{} -n 1 dig +short -x 206.214.251.{}
>>
>>51971658
only if X forwarding is enabled server side

who the fuck still uses X forwarding?
>>
<command> | grep "<word im looking for>"

echo "butts" >> <filename>

babby here
>>
>>51971889
grep -i ignores case by the way
also grep -v "inverts the search" (IE show things that do NOT meet the pattern)
also grep -e pattern -e pattern2 for OR searches
>>
ls, cd, pwd, mv, exit, grep, locate, awk1, nano/vim2 and regex2.

1. Useful for filtering info alongside with grep. One can really benefit from some simple bash scripts.
2. Not really commands but useful.
>>
>>51971930
neat, I use -i sometimes
>>
>>51971933
vim is most definitely a command in the same way grep is, only vim is interactive
>>
>>51971665
muh files!
>>
>>51971930
Can't you use (one|two) with grep for OR?
>>
ls -al
>>
>>51971933
What does awk1 do?
>>
>>51971586
sudo install gentoo
>>
>>51971999
It's just awk, I messed up the subscript numbers. You can use for example:
awk '{print $2}'
It'll print every second column of every line. You can also print $1 $3 $6. Awk is a stream editor for many purposes.
>>
>>51971993
>ls -al
ls -alp

always remember the -p flag as that will add a slash behind all directories so you know which names are files and which are directories
>>
>>51971879
what do you use, faggot?
>>
>>51971980
I think the difference is that grep -e compares to separate regexes, where as | combines two strings to a single regex. I think the only time there might be a difference would be with like really long regexes
>>
ctrl-d closes the terminal so you dont have to type exit
>>
ls -la | wc -l; du -ch | sed -n '$p'
shows how many files/folders and their total size
>>
>>51972057
vnc
Isn't X forwarding incredibly insecure?
>>
File: 1332950465933.jpg (76 KB, 600x670) Image search: [Google]
1332950465933.jpg
76 KB, 600x670
use 'history -c' after you've finished h4x0ring to make urself untraceable
>>
>>51972092
If done through xhost, yes. You can use it over ssh in a separate session, which would not be insecure, but will not be connected to an already existing session.
>>
>>51972160
>xhost
care to explain?
>>
>>51972108

Sometimes I use it because I don't want person whom I share the user with know that I'm too retarded to use linux.
>>
>>51971586
>filename
>confusing ubuntu with linux as a whole
>>
>>51972239
>2k15
>sharing user accounts
...
>>
if you have hundreds of files that you have to rename with the same pattern, its good to use rename

rename s/*xx.jpg/""/

I think that changes xx in all files that have xx to the empty string, I cant remember exactly
>>
sort -u, sort | uniq, sed "s/old/new/"
>>
>>51972108

useful if you enter a command with a password inline

>>51972239

bolshevists in full force on 4chan today
>>
>>51972239
Does you first letter of first name start with B?
>>
>>51972207
It disables X security. X works on a server/client fashion spawning a server for each client. The client can only connect using a special token file. You can use X on the target computer from a separate session through ssh. You can only access an already running session teamviewer-like by disabling X security.
>>
killall [application]
man [command]
less [file, usually text]

Learn the basics of tar. You have to learn the utter basics of one terminal text editor that's included in most Linux distros (vi, nano, or others) in case anything goes weird.

Most other things are
* easily searchable online
* prominently included in every terminal tutorial
* too specific for truly general use
* or just not a big deal.
>>
If you're looking for a certain filename, you can use
find <directory>
, which you can then pipe into
 | grep file


ie.
find / | grep \.c
to find all .c files on the disk
>>
tail -f logfile

Great for monitoring changes in a logfile as they happen
>>
File: skypepe.png (352 KB, 800x800) Image search: [Google]
skypepe.png
352 KB, 800x800
>>51972437
very good
>>
>>51972437

Or you could just use
find <place> -name <thing>


e.g.,

find / -name *.c


to find all .c files on disk.
>>
>>51972513
add 2> /dev/null to remove all error output
>>
>>51972360
Don't worry, I'm not.
>>
>>51971586
Some sound effects to play with sox:

Pinknoise, to help you concentrate in noisy environments:

play -c 2 -n synth pinknoise band -n 2500 4000 tremolo 0.03 5 reverb 20 gain


Ocean sound:

play -n -n --combine merge synth pinknoise band -n 1200 1800 tremolo 50 10 tremolo 0.14 70 tremolo 0.2 50 gain  -10


Enterprise ship background sound:

play -n -c1 synth whitenoise lowpass -1 120 lowpass -1 120 lowpass -1 120 gain +14
>>
ssh -XY <hostname>
scp
>>
wget
>>
>>51971586
press 'up' arrow to get the previous command.
>>
Learn regular expressions and flags on basic commands

mv -i *.png /mnt/backup/pictures/


This would move all pngs from the current directory to that folder and prompt you incase of conflicting filenames before overwriting.
Thread replies: 47
Thread images: 3

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.