What helps people get comfortable on the command line? (jvns.ca)
from learnbyexample@programming.dev to linux@lemmy.ml on 06 May 04:05
https://programming.dev/post/29824084

#linux

threaded - newest

SnotFlickerman@lemmy.blahaj.zone on 06 May 04:25 next collapse

In my experience repetition helped. Not memorization, but more like muscle memory.

Also, ensuring to never copy and paste commands but to type them in manually yourself. It’s hard to enforce this on yourself, but worth it.

I appreciate that this article started with “ways to reduce risk” because that’s an extremely valid concern and tied to why you shouldn’t ever copy and paste. The one time in my early Linux forays where I copied and pasted I wiped the wrong drive. It definitely taught me to always manually type it in and not get too lazy, because what you copied might not match what you want to do exactly.

remotedev@lemmy.ca on 06 May 05:32 collapse

Also, ensuring to never copy and paste commands but to type them in manually yourself. It’s hard to enforce this on yourself, but worth it.

“Command: sido not found…”

Brocon@lemmy.world on 06 May 05:57 collapse

As a fan of german rap this gave me a good chuckle. Thx.

Matth78@lemm.ee on 06 May 04:40 next collapse

What helps me is to understand what commands acronym means. For instance cp for copy, mkdir for make directory, blkid for block id, ls for list (not too sure about actual meaning for s) and so on!

Nice tips about ctrl+r to search in command history. Was not aware it existed!

Tlaloc_Temporal@lemmy.ca on 06 May 04:49 next collapse

‘ls’ is an abbreviation for ‘list’, not an acronym. Like copy -> cp, and the other keystroke saving abbreviations.

iopq@lemmy.world on 06 May 08:15 next collapse

pwd for password, man for mansplain, and dd for destroy disk

Sonotsugipaa@lemmy.dbzer0.com on 06 May 08:57 collapse

Hey, the first two don’t sound quite right

josefo@leminal.space on 07 May 04:08 collapse

works for common flags too, like in df -h, the h stands for human readable, I always find myself mumbling “human” while typing that one

33manat33@feddit.org on 06 May 04:43 next collapse

Okay, this is not Linux-specific, but it’s about a transferable skill:

What helped me get comfortable and learn a lot of basics was setting up NetBSD. The basic install throws you into a basic command line, with no graphical interface installed and not even the internet configured. But the online guide for setting the system up is incredibly well-written and teaches you all the concepts you need to know.

After doing this, I was familiar with a larger set of terminal commands, knew how to use vi, had a bunch of practice setting up config files in CLI and even finally learned how pipes work. It’s a very enjoyable experience, the guide is so good I didn’t feel overwhelmed once and anything you have to look up is tied to a problem you’re solving (like cursor movement in vi).

It also teaches you how NetBSD is structured. It’s not Linux, but similar enough to understand a lot of how and why things are done in Linux systems

southsamurai@sh.itjust.works on 06 May 04:48 next collapse

Really specific here, but font control.

Us folks with dyslexia in its various expressions have trouble with command line. If you can’t read a specific command, good luck ever getting comfortable with it. You can’t error check yourself, so until you build up memory, you’re kinda screwed if you can’t use the fonts that are available.

lordnikon@lemmy.world on 06 May 05:19 next collapse

To things that helps no mater your skill level the tab key is your best friend and man pages are great but if those are overwhelming install the package tldr then you can use the command tldr and the command you are trying to run to give you helpful examples of how to use that command.

Also old users don’t remember long commands if we use a command more than once. You save it to your bash alias file to create your own commands.

zygo_histo_morpheus@programming.dev on 06 May 08:19 next collapse

tldr is great, sometimes you can’t remember the exact syntax for a certain command and just need a quick reminder as well.

N0x0n@lemmy.ml on 07 May 03:16 collapse

Also old users don’t remember long commands if we use a command more than once. You save it to your bash alias file to create your own commands.

A good example for this is docker compose -f when you work alot if compose files ! Having an alias for docker compose -f as dcf saves hours a month xD

eugenia@lemmy.ml on 06 May 05:25 next collapse

Step 1: Use a youtube tutorial for the basic commands. Don’t worry, you’ll forget about them soon enough. But doing them once, helps with muscle memory.

Step 2: When in need to do something, copy/paste from Q&A/forums various commands that they suggest for your problem. Your basic knowledge from step1 will come back as you do that.

After a few days, you’ll be understanding what’s going on and how the whole thing works in an abstract level.

Zykino@programming.dev on 06 May 06:31 collapse

I would recommand to never copy paste but retype so you have the commands on your finger memory.

Also don’t be afraid to –help everything. It give more option for commands you know quicker than the man.

nis@feddit.dk on 06 May 05:26 next collapse

Clear instructions on how to do a clearly defined, specific task, in a failsoft manner, faster and easier, which helps them in a project they are doing now.

cmnybo@discuss.tchncs.de on 06 May 05:28 next collapse

Play around in a virtual machine so you don’t have to worry about messing anything up. Start with the basics such as navigating through directories and creating, editing, and moving files. If you break something, just restore a snapshot.

a14o@feddit.org on 06 May 06:33 next collapse

The way I usually start teaching using the console to my (very much non-tech) students is set up a safe container and then let them type whatever, invariably generating a lot of error messages. Then I challenge them to generate different error messages, “gotta catch em all” style. Then we talk about the error messages and what they might mean. After this exercise they usually get the basic idea of command – response, what to look out for and how to compose valid commands.

prole@lemmy.blahaj.zone on 06 May 12:18 collapse

That’s clever

prole@lemmy.blahaj.zone on 06 May 12:18 collapse

Or just use Time Shift or a similar tool. I broke my first linux install like a dozen times, and I learned so much about how my computer operates in the process.

pemptago@lemmy.ml on 06 May 06:07 next collapse

Stumbled across a game that teaches the command line as you play it. Seems like a good place to share gitlab.com/slackermedia/bashcrawl

personally, writing and saving simple scripts - IE project based learning - is how i got time in the saddle.

A_norny_mousse@feddit.org on 06 May 06:43 next collapse

Colors. And a nice, readable font. Make your terminal pretty so you feel good every time you interact with it. Think about window dimensions (I personally always find the standard 80x24 too small), maybe set up some manual tiling so you can have two terminal windows fill your screen. Use the keyboard to move around your desktops.

But mostly, colors.

whaleross@lemmy.world on 06 May 10:10 next collapse

And the message “DON’T PANIC” in big friendly letters.

AndrewZabar@lemmy.world on 06 May 11:16 collapse

And make sure you know where your towel is.

[deleted] on 06 May 14:00 collapse

.

A_norny_mousse@feddit.org on 06 May 14:42 collapse

Or a nice prompt that creates a distinguishable marker across output.

socsa@piefed.social on 06 May 06:45 next collapse

Working in a remote environment

AndrewZabar@lemmy.world on 06 May 11:15 next collapse

As someone who started with nothing but command line - Timex Sinclair, Apple IIe, DOS, I can’t even relate to the concept of being scared of command line.

Horse@lemmygrad.ml on 06 May 11:22 next collapse

  1. making it ✨pretty✨
  2. using it a bunch
  3. man pages
  4. arch wiki
grrgyle@slrpnk.net on 06 May 11:29 next collapse

Virtual environment? Taking notes of what they did?

Anyway, tell them it’s okay you experiment and mess things up. Show them how to backup their important work. Then walk them through inevitably having to reinstall their distro.

They’ll learn that you can just keep moving forward, fixing and learning as you go.

savedbythezsh@sh.itjust.works on 06 May 11:48 next collapse

Maybe controversial, but the fish shell. I know it’s not strictly bash syntax, but the OOTB features are just so user-friendly. The most helpful features for learning: the autocomplete (with descriptions of subcommands and flags!) and the fuzzy history search.

I write bash scripts all the time, and am significantly more knowledgeable than anyone else on my team (admittedly frontend) because I got comfortable in fish.

prole@lemmy.blahaj.zone on 06 May 12:15 collapse

I use Fish sometimes, even when I know exactly what I need to type, but just don’t feel like having to type out entire file names.

furrowsofar@beehaw.org on 06 May 12:05 next collapse

The need to do it plus the realization that you can script anything based on it.

Drivers. Using recovery mode. Administration. Wanting to describe what to do rather then manually do it. Wild cards are really powerful and so is find and xargs. The text processing commands are useful too.

The other thing is having started computing in the 1970s. Everything was command line back then. GUI systems only become universal in about 1995.

zarkanian@sh.itjust.works on 06 May 12:21 next collapse

For me, it was having a cool-looking and user-friendly terminal app.

mpblack@lemmy.ml on 06 May 12:53 collapse

How do you get a terminal app that’s cool and user-friendly? Any recommendations?

ILikeBoobies@lemmy.ca on 06 May 14:25 next collapse

Install some terminal apps

Examples:

github.com/clangen/musikcube

github.com/yorukot/superfile

This is the font I use

github.com/ryanoasis/nerd-fonts/tree/…/M-DZ

I also use ghostty because it’s themeable, I found adding transparency helped me because i can have whatever I need to see under the terminal (helps for command cheatsheets)

mpblack@lemmy.ml on 06 May 14:34 next collapse

These do look nice 🤩 Thanks!

dRLY@lemmy.ml on 07 May 21:00 collapse

SuperFile looks cool, just installed it!

zarkanian@sh.itjust.works on 06 May 16:21 next collapse

Konsole and yakuake. Bear in mind that the terminal I was comparing them to was Windows’ CMD.EXE, and anything is better than that.

Yakuake is a Quake-style terminal, which means that you can open and close it with an F-key, and it scroll down from the top of the screen. This is both cool-looking and convenient. I like to have some window transparency, so that I can see through the terminal window somewhat. I also like to use a nerd font like Fantasque Sans Mono.

N0x0n@lemmy.ml on 07 May 03:10 collapse

Kitty is also a good example ! Very customizable but maybe less user friendly to begin with.

SplashJackson@lemmy.ca on 06 May 12:49 next collapse

I set it so when I hit CTRL-Tilde it drops down from the top of the screen.

Quake-style, baby.

Hawke@lemmy.world on 06 May 14:03 collapse

CTRL-tilde or CTRL-backtick?

SplashJackson@lemmy.ca on 06 May 16:49 collapse

Yes

railcar@midwest.social on 06 May 13:13 next collapse

Using computers since before GUI was available… Sometimes I think we ought to go back to it

applemao@lemmy.world on 06 May 13:26 next collapse

I think just doing it more, and thinking it’s cool to interact more directly. At least that helps me. I do feel bad for dyslexic peiple though, it’s a lot harder for them to use CLI.

CrabAndBroom@lemmy.ml on 06 May 15:41 collapse

Yeah that was it for me. Just keep regular backups and bear in mind that you’ll probably break stuff at first. But once you get the hang of it, it’s like a whole other level of control over your system.

Also I’m not dyslexic but would things like tab completion and aliases help maybe? I sometimes shorten often-used commands with aliases just for convenience (as an example, I use rsync a lot, particularly the command rsync --ignore-existing -ravwhich I just shorten to rs to save time) so maybe that could also be used to avoid mis-spelling?

applemao@lemmy.world on 06 May 20:56 collapse

Thats a good idea, i have not made any aliases yet. Also remembering all of those aliases is another challenge ha. I keep a text file named commands on my desktop with a whole bunch of commands I forget.

CrabAndBroom@lemmy.ml on 07 May 14:25 collapse

I have some mapped to super simple aliases too like e1 to reboot, e2 to shutdown etc. I don’t remember why I started doing that, but that way I only have to remember which number does what lol.

Termight@lemmy.ml on 06 May 14:22 next collapse

Mastering the command line? A few observations. First, consult and take notes (yes, even seasoned terminal veterans forget syntax.) Secondly, embrace tab completion. It’s your friend, and a surprisingly effective substitute for remembering every single command. Third, the true test: procure a VPS or remote server and exclusively use the command line. No GUI crutches allowed. It’s a digital wilderness, and you’ll learn to navigate it.

Lastly, and this is non-negotiable: keep a terminal window permanently resident on your desktop. Consider it a vital organ, deserving of its space. It’s a constant reminder of the power you wield, and a readily available portal to a world beyond the pretty buttons.

absentbird@lemm.ee on 06 May 14:27 next collapse

I upvoted this comment multiple times while reading.

N0x0n@lemmy.ml on 07 May 03:02 next collapse

Hehe, I’m doing this all the time now ! 3 years ago when I started my linux/self-hosted server journey with debian: CLI only !

Was difficult at times and had a few breakdowns (most got fixed the next day… Sleep/taking some time off really helps !!!)

One thing I’m still bad at… Is taking notes. Haven’t found a good way take IT notes. And I tried sooo many different approaches…

Termight@lemmy.ml on 07 May 13:51 collapse

Breakdowns are inevitable; a good night’s sleep is often the most elegant solution. :) I utilize Zim (for note management) as plain text remains a perfectly serviceable option, imo.

WalnutLum@lemmy.ml on 07 May 06:12 collapse

On that front: to developers-

Please make sure you include bash completions for your tools

ABetterTomorrow@lemm.ee on 06 May 15:27 next collapse

I’m trying to make it a regular thing but my problem is I like to get my hands dirty by working on projects. The snag is that I get stuck a lot due to not knowing basics. My personality gets in the way = get dirty and learn fast(not necessarily shortcuts). Maybe I haven’t found that right source to learn that not too beginner and not too intermediate. Maybe a cool cluster of small projects to setup your computer then environment to setting up projects to do your everyday life takes to what you really want to learn.

IceVAN@beehaw.org on 06 May 16:47 next collapse

Practice.

doubtingtammy@lemmy.ml on 06 May 17:02 next collapse

/

to search man pages was a gamechanger

[deleted] on 07 May 15:59 next collapse

.

phantomwise@lemmy.ml on 07 May 15:59 collapse

using tldr instead of man 90% of the time to preserve your sanity

🎉 COLORS ! READABILITY ! CONCISION ! CONCRETE EXAMPLES ! 🎉

FauxLiving@lemmy.world on 08 May 01:00 collapse

tldr is very useful

Also, knowing vim keys is useful because a lot of terminal programs use them.

cyberwolfie@lemmy.ml on 06 May 17:13 next collapse

tl;dr: Gradual exposure over time.

I got used to it through work, as I had to ssh into a server to run simulations. That mainly involved navigating the file system and text editing (which I used vim for) to make some basic Python and bash scripts, including sed and awk. The latter two I never got comfortable using, and haven’t really touched since.

I was using macOS at the time, and after using that for work, the terminal in macOS got at first less scary and then a preferred way of accomplishing certain tasks. On my work Windows computer I started missing having a proper terminal around, and I eventually found Cygwin and later Git Bash to give me that terminal fix in Windows as well. Especially with the latter I noticed few differences and could use it to a large extent as I would have on my then Macbook.

2-3 years ago I was in need of a new computer, and at that point a laptop with Linux on it was not a very scary prospect. That is by no way saying I went into Linux as an expert, far from it, and I am still very much a newbie - but opening the terminal to work with things is not at all a barrier, which helps a lot if you use Linux and want to be able to do some changes from the defaults. If you don’t want that, I think you can go far these days without opening the terminal, but it is certainly a good skill to have.

yesman@lemmy.world on 06 May 22:08 next collapse

I am a Linux noob as far as the desktop goes. But I’m quite comfortable in the terminal because for years I’ve maintained a home server running Debian. After I install the OS, I unplug the keyboard and monitor and the only way to talk to that box is through SSH.

kepix@lemmy.world on 07 May 01:15 next collapse

if the avg enduser has to temper in a commandline, your program is ass.

WereCat@lemmy.world on 07 May 03:56 next collapse

Knowing the commands

josefo@leminal.space on 07 May 04:03 next collapse

For me it was self hosting, aka not having a choice but to learn. I’ll be dead before using remote desktop for that.

Also, self hosting gives you real motivation, because you actually need to do things, carry tasks, not just learning for the sake of it. Your efforts get immediately rewarded with functioning things.

utopiah@lemmy.ml on 07 May 05:37 collapse

real motivation, because you actually need to do things, carry tasks, not just learning for the sake of it. Your efforts get immediately rewarded with functioning things.

Yes indeed, and that’s true for any challenging skill to hone.

the_wiz@feddit.org on 07 May 05:47 next collapse

Well, it’s easy… just be born in the early 80s and grow up with home micros!

zapz@lemm.ee on 07 May 06:09 next collapse

I want a dropdown terminal la guake and yuake. Both options don’t work on my Fedora. Because of this, I almost never use the terminal.

pineapplelover@lemm.ee on 07 May 06:18 next collapse

Practice I guess. Especially using cli for specific tasks that is done more efficiently on there than the gui.

Moving files using regex for example is useful. Or finding files with specific phrases in them. Stuff like that

skozzii@lemmy.ca on 07 May 15:31 next collapse

When you aren’t in a rush try to do stuff in command instead, looking for a file? , try to find it in command. Need to copy and move a folder? Don’t use your file manager, use the command line instead.

Eventually you will piece together the bits you learn and it starts to make sense, and then you feel like a God. Lol.

pineapple@lemmy.ml on 08 May 02:43 collapse

I 100% agree. I’m still relatively new but this helped me become much more confident.

phantomwise@lemmy.ml on 07 May 15:49 next collapse

I have no clue… I grew up on Windows 3.11 and I thought Windows was kinda lame while MS-DOS was the coolest thing ever because you typed things like magic spells 😅

bitjunkie@lemmy.world on 07 May 20:45 collapse

This right here (more or less - first home PC was Win95, but it still relied pretty heavily on DOS, esp for games). I loved the RPGs where you typed in your actions, too.

ConstantPain@lemmy.world on 07 May 16:14 next collapse

Have someone on Google doing the thing I need to do.

Shayeta@feddit.org on 07 May 20:02 next collapse

Knowing:

  • pwd, ls, cd, cat/less, cp, mv, rm, rmdir, rm -rf, ls -lah
  • command --help
  • man command | grep thing I care about
  • bonus points if you have tldr command installed
stringere@sh.itjust.works on 07 May 20:57 next collapse

Good cushions

h3mlocke@lemm.ee on 08 May 02:56 next collapse

C:[Enter]
###

ikidd@lemmy.world on 08 May 03:12 next collapse

Breaking things.

creamlike504@jlai.lu on 08 May 03:57 collapse

I’ve done this. It had the opposite effect.

Fizz@lemmy.nz on 09 May 10:09 next collapse

Doing hackthebox or other CTF challenges, Using CLI software, writing bash scripts.

spv@lemmy.spv.sh on 09 May 16:21 next collapse

in my experience, practice, practice, and more practice. but “just git gud m8” isn’t really helpful advice. if you don’t have half a decade on hand, i can make a few more practical recommendations.

a shell that can do argument autocomplete is your best friend. personally, i use zsh + ohmyzsh + fzf + fzf-tab, but i’m sure there are other configs, and i’ve heard ohmyzsh is a bit of a nightmare, though i haven’t had too many issues.

so let’s say you’re running the one rsync command this month, and you forgot the args, just tab-tab and you can search through the arguments with fzf.

<img alt="fuzzy search of autocompleted command arguments" src="https://spv.sh/img/fzf_demo.jpg">

dragospirvu75@lemmy.ml on 15 May 13:21 collapse

2 things got me comfortable on command line: 1) A great cheat sheet (one from Ubuntu: ubuntu.com/download/server/thank-you); 2) Practice all the commands from the cheat list regularly. Last page is something for Pro version, but first 2 pages are great for a begginer. There is a typo at a command (or it was in a past cheat sheet): “Sudo change <username>” instead of “sudo chage <username>”. It helped me most to get comfortable with terminal. Enjoy!