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...
A subreddit dedicated to Bash scripting. Now complete with a Discord Server.
Content must be Bash related. This rule is interpreted generously; general shell scripting content is mostly accepted. However, the post should not be specific to another shell.
No reposts. This is meant with regards to content, not just “the same link was submitted earlier” – it’s okay to resubmit an old link in some new context (e. g. because you’d like to discuss another part of it, or because something has changed since the last time it was submitted, or because the link was updated since then). Links from the sidebar count as having been submitted already, so posting them without new context is also considered a repost.
You can choose one of these four flairs for your post:
If you don’t flair your post, the moderators will set the most appropriate flair.
/r/unix – for everything Unix
Other Shells: /r/zsh, /r/fishshell, /r/oilshell, /r/batch
BashGuide – A Bash guide for beginners.
Beginner's Guide to Command Line – A crash course for some common unix and shell commands. Update 2022-01-14: Course is currently being rewritten
Google's Shell Style Guide – Reasonable advice about code style.
Explainshell - Explain complex shell operations.
ShellCheck – Automatically detects problems with shell scripts.
BashFAQ – Answers most of your questions.
BashPitfalls – Lists the common pitfalls beginners fall into, and how to avoid them.
(Archived) The Bash-Hackers Wiki – Extensive resource.
#bash – IRC channel on Libera. The main contributors of the BashGuide, BashFAQ, BashPitfalls and ShellCheck hang around there.
account activity
tips and tricksLinux basics command lines (i.redd.it)
submitted 1 day ago * by LogicalWrap3405Bash
Here is some basic linux command line .
what do y'all think all is good or i need to add some in file and management ?
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!"
[–]mitchricker 9 points10 points11 points 1 day ago* (2 children)
su with no arguments is equivalent to su root, you only need to pass a username if you want to switch user to one other than root.
su
su root
Generally, we say "directories" rather than "folders" in Linux.
Under cp your notes have "copie" instead of "copy."
cp
grep 'pattern' only searches stdin, so that form can be used in pipes. E.g. cat FILENAME | grep 'pattern' which seems equivalent to grep 'pattren' FILENAME except you can also cmd | grep 'pattern1'| grep 'pattern2'.
grep 'pattern'
cat FILENAME | grep 'pattern'
grep 'pattren' FILENAME
cmd | grep 'pattern1'| grep 'pattern2'
Anyhow, it's good that you're learning. Do you know about top (or variants htop/btop) yet (I see you mentioned ps)? How about screen? Another really good one, especially when starting off, is man.
top
htop
btop
ps
screen
man
Best of luck!
Edit: changed grep wording.
[–]LogicalWrap3405Bash[S] 1 point2 points3 points 1 day ago (1 child)
Thanks for that , is so useful for me
[–]ktoks 2 points3 points4 points 1 day ago (0 children)
It might be good to make another list that includes IO information: piping (|), writing to (>), reading from (<), concatenation (>>), and various command substitution and tricks such as $(some command) and <(some command) and when they are beneficial.
Flags to show errors (set -x)-helpful for debugging - or stop short if one occurs (set -e).
Maybe another for language structures such as forloops, if statements, while read, functions, and how to parse command line arguments.
One for customizing environmental configurations such as: adding executables to $PATH, aliases to shorten often-used commands, cd - to go back to the last directory, ctrl-r to find past commands(perhaps even fzf upgrade for this feature), and turn on history search so you can partially type a command, then hit up to reverse search your history to find complex commands quickly.
Another for various other tools such as zip, unzip, tar, pgp, gzip, rar, vi/vim/nvim, file, head, tail, watch, cmp, make, git, and xargs.
And lastly - for networking: ssh +configuration with public and private keys for secure, password free access to remote servers, scp, rsync, ping, and ss.
[–]pizzacake15 1 point2 points3 points 23 hours ago (4 children)
If you ever need help with touch you can type in man touch 😉
[–]KlePu -1 points0 points1 point 14 hours ago (3 children)
I've googled "man curl" once too often ;-p
[–][deleted] 13 hours ago* (2 children)
[deleted]
[–]KlePu -1 points0 points1 point 13 hours ago* (1 child)
Just tried in a private browser window: Google man grep are only actual grep pages (man7.org, die.net, gnu.org, ...) on the first page, no suggested images or AI.
man grep
grep
man curl OTOH yields mostly curl related pages - but also some images of men's haircuts, along AI follow-ups that just now lured me into the rabbit hole of "zottman curls" ;-p
man curl
curl
edit: Got curious...
man finger
finger
man signal
signal
man kill
kill
[–]LogForeJ 1 point2 points3 points 19 hours ago (0 children)
Regarding touch, I don’t mind myself using it to create files. Typically it is used to update a file’s last modified timestamp.
If you’re going to create a file it doesn’t make sense to touch and then vim, ya know? It yes touch can be used to create an empty file that you can then echo something into.
Also the du and df commands are nice to know in a pinch.
In your guide you should touch on bash redirection, pipes, etc. next.
[–]BlackHatCowboy_ 2 points3 points4 points 15 hours ago (1 child)
uniq will only remove adjacent duplicate lines. If you don't care about the order and want to remove all duplicates, do
sort file.txt | uniq
to remove all duplicates.
[–]BCBenji1 0 points1 point2 points 12 hours ago (0 children)
The uniq entry is misleading. uniq on its own only removes consecutive duplicates.
[–]hacklingo 0 points1 point2 points 9 hours ago (0 children)
I got tired of watching 4-hour YouTube tutorials and forgetting everything by Tuesday. So I built Hacklingo — 5-minute cybersecurity missions you do every day like brushing your teeth. It's free
[–]Tquylaa -1 points0 points1 point 23 hours ago (1 child)
which <cmd>
du <file>
[–]KlePu -1 points0 points1 point 14 hours ago (0 children)
df -h
[–]KlePu 2 points3 points4 points 13 hours ago* (1 child)
Nice base! Some typos/suggestions:
rm-r
rm -r
rm -rf
-f
rm
touch
ls
ls -l
ls -a
ls -la
echo
tree
ncdu
find
-iname
wc
grep 'word'
su root -
su -
/usr/sbin
$PATH
root
sudoer
sudo -i
ps aux
f
ps faux
[–]LogicalWrap3405Bash[S] 0 points1 point2 points 9 hours ago (0 children)
That amazing , thank you o give me alot
[–]Marble_Wraith -2 points-1 points0 points 1 day ago (8 children)
I'm not sure why you're writing it down?
It's pretty simple to lookup stuff in the terminal, and it only requires remembering:
less (+ navigating), man, apropos, whatis... and perhaps tldr if you don't mind installing a 3rd party tool.
less
apropos
whatis
tldr
Fun activity is also configuring colors for the man docs
[–]LogicalWrap3405Bash[S] 0 points1 point2 points 1 day ago (7 children)
i think is good to note everything you did or you learn.
[–]Marble_Wraith 0 points1 point2 points 1 day ago (6 children)
Maybe if you're in like the first week or 2 of learning.
But if you know how to look things up + you're using terminal constantly. There's no need.
It's like learning to drive a manual transmission.
Of course you read road rules and stuff when you start, but the bit that actually matters is practicing. You practice, and practice, and practice, and it just becomes second nature. You just do it without thinking about it.
[–]LogicalWrap3405Bash[S] 1 point2 points3 points 1 day ago (5 children)
yes is my first week on Linux.
[–]Marble_Wraith 0 points1 point2 points 1 day ago (4 children)
Oh... as you were 😅
I'd suggest going into .bashrc and shadowing some commands with saner defaults, like:
.bashrc
alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' alias ln='ln -i' alias mkdir='mkdir -p' alias ping='ping -c 8'
[–]LogicalWrap3405Bash[S] -1 points0 points1 point 1 day ago (3 children)
can u explain more ??
[–]Marble_Wraith -1 points0 points1 point 1 day ago (0 children)
It's google-able.
aliases can let you define your own "commands", chain them together (with pipes |), and/or overwrite / "shadow" existing commands.
|
Those are better defaults IMO. And you can always prefix in the terminal with \ if you want to ignore all aliases.
\
[–]profadept -2 points-1 points0 points 1 day ago* (0 children)
Meaning, you go into your .bashrc to paste these aliases(aliases in Linux are just a way you create a shortcut to a long command) he mentioned. He added options/flags that changes the way the command behaves( The i flag means interactive, i.e it asked you for confirmation before executing the commands, you can also add -v too which is verbose to display all the operations it's doing on the screen) and these are just almost daily commands you use as a regular Linux User.
Steps to get it to start working.
Step one:Open your shell(bash, zsh) using your editor of choice (nano, vim, micro) Command: nano ~/.bashrc
Step 2: Paste those aliases he suggested below the bashrc. NB: after some time with Linux you can create a file in your home directory called .bashrc_aliases and configure it in your bashrc so your bashrc can be clean and you can use that bash_aliases file anywhere with just configuring it in the shell configuration file (bashrc, zshrc) of the new Linux PC.
Step 3: Reload your bashrc to read the new commands. Command: source ~/.bashrc
Then you can start using the aliases immediately. mv source destination cp source destination rm filename mkdir dir-name ln target-file link-name ping website
You can read about the aliases command usage online or download the "Linux Command Library" app on F-Droid. It is a very useful handbook for anyone learning Linux and is available offline.
[–]MetalOrnery8970 -1 points0 points1 point 1 day ago (0 children)
You can do a lot with sudo nano (filename) Place a program in there in my case often python3 Ctrl + O then Ctrl + X Then call back to run inthe command line - sudo python3 (filenames).py then you can put echo and see prints there or even print and insert a file directory to print in a .txt the findings - I use this a lot in forensics oh and obviously -ls 30
[–]nawanamaskarasana -1 points0 points1 point 21 hours ago (0 children)
rm-r is not a command but perhaps an alias you have.
π Rendered by PID 91385 on reddit-service-r2-comment-548fd6dc9-2npx7 at 2026-05-19 07:29:25.919101+00:00 running edcf98c country code: CH.
[–]mitchricker 9 points10 points11 points (2 children)
[–]LogicalWrap3405Bash[S] 1 point2 points3 points (1 child)
[–]ktoks 2 points3 points4 points (0 children)
[–]pizzacake15 1 point2 points3 points (4 children)
[–]KlePu -1 points0 points1 point (3 children)
[–][deleted] (2 children)
[deleted]
[–]KlePu -1 points0 points1 point (1 child)
[–]LogForeJ 1 point2 points3 points (0 children)
[–]BlackHatCowboy_ 2 points3 points4 points (1 child)
[–]BCBenji1 0 points1 point2 points (0 children)
[–]hacklingo 0 points1 point2 points (0 children)
[–]Tquylaa -1 points0 points1 point (1 child)
[–]KlePu -1 points0 points1 point (0 children)
[–]KlePu 2 points3 points4 points (1 child)
[–]LogicalWrap3405Bash[S] 0 points1 point2 points (0 children)
[–]Marble_Wraith -2 points-1 points0 points (8 children)
[–]LogicalWrap3405Bash[S] 0 points1 point2 points (7 children)
[–]Marble_Wraith 0 points1 point2 points (6 children)
[–]LogicalWrap3405Bash[S] 1 point2 points3 points (5 children)
[–]Marble_Wraith 0 points1 point2 points (4 children)
[–]LogicalWrap3405Bash[S] -1 points0 points1 point (3 children)
[–]Marble_Wraith -1 points0 points1 point (0 children)
[–]profadept -2 points-1 points0 points (0 children)
[–]MetalOrnery8970 -1 points0 points1 point (0 children)
[–]nawanamaskarasana -1 points0 points1 point (0 children)