r/linuxquestions • • 14h ago

What’s a good beginner-friendly guide to using the Linux terminal

I’m using Linux and want to learn the basics of the command line so I can manage files and do everyday tasks without relying on the GUI too much. For example, I’d like to learn how to move folders, work with files, and save command output to a .txt file.

What tutorials or resources would you recommend for a beginner?
If you had only two days to learn the CLI, what would you focus on?
Thanks :)

1 Upvotes

12 comments sorted by

1

u/pacpecpicpocpuc 14h ago

Try to do what you want to achieve. Google when you don't know how to. Repeat.

2

u/mohamedibrahim456 14h ago

So learn by doing?

1

u/doc_willis 14h ago edited 14h ago

http://linuxjourney.com

  (old)  and the newer 

http://Linuxjourney.org

 sites are good to start with.  The Explaining Computers  YouTube Channel videos is a  good starting point for learning. 

1

u/mohamedibrahim456 14h ago

what would you focus on when learn

2

u/doc_willis 14h ago edited 14h ago

you said you want to learn the CLI, so that's basically going to be bash

https://labex.io/linuxjourney/courses/command-line

1

u/tomscharbach 14h ago

I would start with The Linux Command Line for Beginners (Ubuntu Desktop Documentation) to get your feet on the ground and then materials from The Linux Handbook.

However, keep in mind that the command line is a tool, best learned by using the command line to do what you need to do or want to do.

I realize that you cannot do this with "only two days to learn the CLI" but after you are over the crunch, I would suggest settling down, devoting a two or three hours per week to figuring out how to do something that you do normally with menus and what now but using the command line instead.

You will be surprised, I think, how much you learn in a few months.

Learning by doing sticks.

1

u/mohamedibrahim456 13h ago

I’m using Linux and want to learn the basics of the command line for everyday tasks, without relying too much on the GUI. Around 95% of what I want to do is things like these:

- Check a package’s download and disk-space requirements without installing it:

sudo apt install --assume-no mpv 2>&1 | grep -E 'Need to get|After this operation|Download size|Space needed'

- Save command output to a text file:

some-command > /home/mohamed/Desktop/hi.txt

- Append output to an existing text file:

some-command >> /home/mohamed/Desktop/hi.txt

- Find a file when I don’t know where it is, and display specific lines from a text file in the terminal.

What beginner-friendly tutorials or resources would you recommend for learning these kinds of Linux CLI tasks? If you had only two days to learn, what would you focus on?
i'm not "absloute beginner" but i'm not pro either

1

u/Dashing_McHandsome 10h ago

You aren't going to learn hardly anything in two days. That is completely unrealistic. I have been using the command line for 30 years and I still pick up new things from time to time.

1

u/mohamedibrahim456 10h ago

95% of my use is:
- Check a package’s download and disk-space requirements without installing it:

sudo apt install --assume-no mpv 2>&1 | grep -E 'Need to get|After this operation|Download size|Space needed'

- Save command output to a text file:

some-command > /home/mohamed/Desktop/hi.txt

- Append output to an existing text file:

some-command >> /home/mohamed/Desktop/hi.txt

- Find a file when I don’t know where it is, and display specific lines from a text file in the terminal.
so 2 days is kinda realistic

1

u/doc_willis 4h ago edited 4h ago

Find a file when I don’t know where it is,

the find command is of use for that. often used with grep and other commands to filter out things. there is also the locate command that can make a file listing database, which can be searched easily.

display specific lines from a text file in the terminal.

A rather beginner 'bash 101' type problem, with a dozen solutions. Use a combination of cat, tail, head, or other commands like sed, and awk.

cat displays an entire file; use sed to print selected lines, such as

sed -n '25p;45p;65p' filename.txt To print a range, use sed -n '10,20p' filename.txt

Use awk for selected line numbers:

awk 'NR==25 || NR==45 || NR==65' filename.txt

O'reilly has a book covering awk and sed which is worth reading if you really want to gain some super shell power skills.

Use cat -n filename.txt if you want to display the whole file with line numbers.

https://unix.stackexchange.com/questions/288521/with-the-linux-cat-command-how-do-i-show-only-certain-lines-by-number

And there are likely 12+ ways to do the same basic thing as the sed/awk commands above.

tail has a range option.

tail -n 50 filename Show the last 50 lines tail -n +5 filename Show the file starting at line 5

I recall seeing use of both options in various combos of chained commands to get a range of lines. But sed/awk are a likely better for the task.

To print lines 20–30 of file.txt, use:

  tail -n +20 file.txt | head -n 11

Someone with more python, perl, or other programing language skills could likely do a simple script that does the same as the above. I am so 'old-skool' that I learned to do such tasks with REXX and PERL. :)

1

u/mredding 6h ago

Start with ls, then cd. You want know that . is the current directory, and .. is the previous. That's half the battle right there. nano is a popular text editor, you probably have it, and ^ represents the Ctrl key, so ^C is Ctrl + C. You propbably want to know that sudo gives you one-time narrow scope admin access to run a given command - you often need it to modify config files in /etc and exercise many system affecting systemctl commands, like when you start or stop a service.

As for a tutorial, use Google AI as a mentor and tell it you want to tune your system for startup and shutdown, find and fix misconfigurations, tune disk and networking, and benchmark. Work WITH your AI, let it teach you as you go. Don't just copy and paste commands, read along, ask questions, tell the AI you're not familiar but want to learn, and write stuff out that it gives you. You'll develop the skill in no time, and your Linux system will be as fast as ever for it.