One addition to the above. A lot of bash scripts and programs will have a command line argument that allows unattended install by auto selecting the defaults or by specifying them as an argument on the command line. But, you have to be sure if course ... 😁
So today I decided to finally learn about Linux after 17 years of pure Windows computing... and then this video pops up... the timing couldn't be more perfect
other good channels: joe collins, average linux user, chris titus tech, dorian dot slash, switched to linux, infinitely galactic there is a brand new FB group for newbies called Penguin Momentum
The ease of navigating by double clicks to access just about anything kept me as a Windows user for 20+ yrs. Recently I've been making many changes to the registry and user account to give myself more control over this operating system that… you know… paid for and own? Microsoft clearly disagrees and feels I need help from myself by denying access to many things and making it literally impossible in some cases to disable software that sends them usage data. Im now a Linux (Arch) user indefinitely now.
As a kali Linux hacker I can say that this video helped to new users using Linux or looking forward to be using it, just a proposition, if someone wants to be anonymous, use Linux becouse it's really secure and they don't steal your information
I've been watching loads of Terminal tutorials over the last couple of days. I should have known that Chris would have the best video out there. Clear, concise and to the point. I find myself coming away from this video having learnt something instead of watching someone race through their instructions without mentioning their shortcuts.
Been using Linux for months and didn't know half of these. It helps that it's not compulsory to know them since the Mint let's you do many things as you would in Windows, but it's still good to learn.
In my university we have a subject that teaches us how to use the terminal in Linux. Most of the computers run Windows so we need to use a special program, but I just bring my laptop that runs Linux Mint. It's a very interesting subject and the professor who teaches this subject is the best. I'll recommend this video to him to use it in the next year for the next generation of students. Cheers.
Thanks! I used to be a Unix user just to run various pieces of equipment around the lab. Now, thanks to the intrusive mandate of all major computer companies I have switched from Windows and Mac to Linux. It's a great refresher and seems much better than the old days ... much appreciated!
That's a great tutorial Chris! There's a couple of points that I'll add, although it's not much. 1) be aware that `sudo apt install` is distro specific, most (all?) debian based distros use apt but other distros use different package managers, for example I'm on arch and use pacman (cool name btw arch people). 2) if you want to remove a directory with files in it, neither rm or rmdir will work: you have to use `rm -r` just like you have to do `cp -r` on directories. 3) running a command on the terminal is basically just running a program. cp is a program, so is rm and mkdir etc. Some programs, like cp and rm only work if they are run from the terminal, but others (for example chromium-browser (guess what that does)) will work either from the terminal or from the GUI. 4) If --help doesn't give enough info, try `man `. Man stands for manual, and it usually gives a very indepth view of the options and some examples. 5) ctrl-d to exit terminal is pretty efficient IMO They're just a few things I use a lot and thought some people might want to know.
Actually, beginners usually want a very simple explanation, not an in-depth one. Even --help makes an appalling amount of output if all you want is the basics of running the command. Good post otherwise, tho ...someone must have typed --help in your terminal :)
@@Reziac yes of course but there's both in-depth and also the basics covered in this video, I'm guessing it's aimed at people who aren't _complete_ beginners but they may have used CMD before etc.
That too -- as I mention below, I'm an old DOShead, but still find the linux commandline opaque, so this kind of familiarization is actually quite helpful.
I am new in the Linux world, just 3/4 days old. I find your video very valuable and knowledgeable. Thanks for your time in making the video a very useful one to all like me. I really love your clear pronunciation.
The terminal might seem scary at first, but it doesn't have to be. It's pretty easy to learn the basics, and it can make doing certain tasks easier. If you're looking to learn more about the Linux terminal, Joe Collins made a fantastic video which teaches you all the basics I definitely recommend.
This is why I watch your channel. This. You, sir, are thoughtful and generous and patient. I knew all this, but it has been taught well and with the proper pace. Awesome!
This is a good basic foundation to the linux terminal command line. Watch this video 10 times. There's a lot of information to take away from this, but Chris is only scratching the surface, and there is so much more you can do.This is where the real magic happens. I would encourage anyone to use only the command line for a week. I learned Unix in the 70's out of a manual before I had access to a computer, so you can learn this too. Linux is very closely related to Unix. If you know one. You pretty much know the other. I don't see a link to a linux tutorial here, but there are many out there on Amazon.
MSDOS like windows is a rip off of Unix or *Nix to those in the know. DOS or even powershell have anything on the early shells eshell cshell let alone ash or bash. I thankfully skipped the need for dos/windows since I was brought up on SCO ( true SCO ) and Solaris.
@@5argetech56 Me to all the way back from Slackware ( yes the first Linux distro ( a floppy disc ) .. I used to have various SGi kits also ( pizza boxes ) that had irix on them.
As a Systems Engineer, I work with both Windows and Linux machines, mostly servers. I'd recommend anyone who uses Linux to jump into using the Terminal, much as I advise people using CMD Prompt or better still, Powershell on a Windows box. Great tutorial for the novice Linux user!
11:50 It may be instinctive to MS-DOS-experienced users to type “*.*”, but remember such a wildcard will only match names with a dot in them. To match all names, type “*”.
Nice tutorial and I noticed this too! Indeed, the concept of a file extension as a separate "field" of a filename doesn't really exist in Linux at the CLI. It may be a convenience in recognizing the type of data if one makes a name ending in dot-something (or for the gui file manager which maintains application associations). Maybe it's due to this that there is the `file` command which can deduce what kind of file one is seeing even if there is no extension there. Also, while some commands do support --help or maybe -? or -h (linux not always the most consistent!), there is usually more complete help with the man (manual) command. Hopefully viewers are inspired to explore more around the command line!
@@lawrencedoliveiro9104 Yes, but those are far less common. Who puts dots in their folder names? I mean "rmdir dir" and "rm -rf dir" can both delete directories, but one is considerably safer than the other by default.
@@encycl07pedia- Rather common, actually, particularly among system directories. On my Debian system, the command find /etc -type d -name \*.\* | wc -l finds 216 of them.
I just moved over to Ubuntu from windows about a week ago. I’ve been using the terminal a fair amount since installing Ubuntu, mostly for installing packages. Your tutorial has made my life so much easier now that I know the shortcuts and how to navigate through my files. Thank you!
Last week I took with me the old core2duo pc my grandmother used, since she recently bought a laptop. I installed Mint over Windows 10 (it ran so slowly) with the intention to give it away, but now I'm using it as my main machine: I've been inadvertently converted!
Thanks Frank. I've also found that many old PC's run horribly slowly with Windows 10 but run much faster with Linux, for example MX or Xfce versions of Mint (etc....).
In 21 minutes you’ve explained the basics far better than some videos that are hours long. I wanted to learn Linux because of the terminal and not in spite of it, I used to enjoy using MSDOS and XTree gold when they were real programs.
This is so true -- knowledge that is not excercised somehow drains from our skulls. I sometimes have to go back to my own videos (or scripts therefore) to check what I "know" about something! :)
@@ericscaillet2232 You shouldn't duplicate names like that. It's just asking for problems and confusion, especially when copying between filesystems. You're very likely to wipe one of the folders/files out.
You got a like from me for one reason alone. I had always thought the progression was aptitude, shortened to apt, then, to avoid confusion GET was added to show what apt did when run, for Windows dummies like me....I had NO IDEA that apt was newer than apt-get. You learn something new everyday....
It's been decades since I really worked on a computer from the command line interface (in the context of using a PC), probably 1993, and yet I can still remember learning MS-DOS before then, at school, and continuing in computer training. I might get a book on Linux as I intend to re-purpose an older PC as a Linux machine.
I learned four new things today: 1. 'cd -' to return to prior directory. 2. rmdir, which is a safer way to remove empty directories than 'rm -r' because it fails if a directory isn't empty. 3. lsblk, which is a more convenient way to determine if a drive/partition is present than ls /dev/sd(expected drive letter)* for those of us who don't allow partitions to automatically mount. 4. Unlike df, lsblk does not need to be run as root to display mountpoint paths that a user without the appropriate permissions would not normally be able to see.
Yet another timely video with the end of Windows 7 support earlier this week, very well explained Chris and makes the whole process seem much easier than many Windows users would have expected.
I learned more in 20 min here than all my attempts at books and texts on the subject. Thank you so much - excellent! Need to re-watch and tale some notes now.
Correct, and to exit the terminal shell, the shortcut is Ctrl-D. The case does not matter for these shortcuts. In days of yore, a terminal was a large, noisy electromechanical machine called a Teletype, the classic model being ASR-33. These machines could only print capital letters.
Kenny Luba - That's the kind of futile detail that Linux users love to throw at newbies. Maybe to create confusion or to brag about their superior knowledge of Linux.
@@RandomNullpointer Well, it dates back to the days of teletypes. You can't erase what's printed on paper so to 'clear' it you issue a formfeed to eject the current page of continuous stationery (fan-fold paper) and start at the top of a new page.
Thanks for a great intro tutorial on the Linux terminal! As someone looking for an alternative to the ever more intrusive and restrictive Windows OS this is very helpful. With each new version of Windows we know even less about what's going on under the hood, not to mention how much Microsoft is spying on users of their bloated operating system.
There is something very satisfying about learning to use the cli and linux in general. I know a fair bit about the shell but it never hurts to brush up and this channel is always a reliable source of useful information that I never have to point out corrections or criticise the fact checking.
The comments are a continuation of this lesson! I am inspired, and I thank all of you who enjoy sharing your knowledge, and not looking down on beginners. We all had to crawl before we walked people. Thank you ALL, especially Chris for starting this information filled basic lesson. I have found it the most exciting place to begin out of all the stuff I've been learning.
Hmm, there's room for improvement. 1) Copy and paste with the terminal is annoyingly much work, but there's a other way that's usually far quicker and has worked on every Linux distro I've used: Just mark the text, it gets automatically moved into a copy buffer, and then anywhere you press your middle mouse key it gets pasted (I. E. The terminal). 2) like others mentioned `apt` is a distro specific command, that's something you should've mentioned 3) also like others mentioned you could've shown `man [cmd]` too 4) while we're speaking of that, another command I find pretty helpful from time to time is `apropos [keyword]`, that one searches all the documents you get shown with `man` (called manpages). That helps you find a commands name if you can only remember what it does, or if you want to find a new command 4) there's autocomplete, and then there's autocomplete suggestions, which in my setup is called when I press tab twice, that's very helpful if you're writing a long directory and can't remember it precisely 5) also the generic nature of `- - help`, where you can often use it on subcommands like `apt install - - help`
I tried here to cover things for beginners; knowing what to leave out is as important as what is included. Not every mouse has a middle button! And doing things with a mouse button click is not good in video, as the viewer cannot see what you are doing.
In fact, in this video you are not using a Terminal but a Pseudo Terminal Slave (PTS). It is just an emulated Terminal. This emulation is done by Terminal Emulators like Xterm. The real Terminal is a TeleTYpe writer (TTY). It is accessible from the Ctrl + Alt + F shortcut. In order to know if you are currently using a PTS or a TTY, type the 'tty' command. I know that the word Terminal is commonly used for PTS so it is acceptable for novice users but I had to explain that for expert users. By the way, great video as always, the basics are explained perfectly.
There is no need to explain it to the experts as we are aware but this is aimed at noobs who wanne become. This is trivial for them at this point in their learning curve. They are not gonna hop TTY for at least another year at this stage and this might only confuse them more.
The 'cd' command without arguments will also return you to your home directory. The 'clear' command can also be done as Ctrl-L, as well. Handy little shortcuts that turn up over time.
I moved to Linux about 4 years ago and have never looked back. The CLI or terminal is immensely powerful and useful particularly for bulk file wrangling activities. I now use the terminal for everything from resizing photos, converting RAWs to PNGs masses of things with AV content in FFMPEG, old drive restoration with powerful disc tools plus bash scripting and so much more. I even browse Google with Googler in the terminal!
*+Алексей* second that. i've been suggesting that on a couple of videos. or even the less exhausting Patreon type route. but seems Chris Sir is a one many army and with other real life work there's only so much he might be getting time to tidy things up. although it doesn't cost that exorbitantly to get someone to create phone or PC applications.. still it's a cost and ..finding the right people.. who remain invested (mentality) invested.. over 2-3 years to iron things out. .. that's a bit tough. unless we all, those with relevant skills, resources chip in too.
Wonderful demonstration of the Linux command language. Everybody who uses a computer should at least be aware that such a thing exists. Knowing how to use it gives us more "direct control" over our devices. My first computer in 1978 used the long-defunct CP/M operating system, and the first IBM PC used MS-DOS, which was an outright rip-off of CP/M. Both CP/M and MS-DOS used only their command languages, since in those days there were no graphical user interfaces like Windows. People now have no idea how useful computers could be using only command languages. In fact, those interactive command languages were themselves a GREAT advance over their "main-frame" computer predecessors JCL (Job Control Language), which were typically commands that had been "key-punched" onto punch card decks so they could be run repetitively using computer card readers as input devices. There were also keyboard computer control consoles where official "computer operators" would often enter commands themselves, one by one. Those console commands were the predecessors of the computer command languages, such as the Linux "terminal" command lines you have demonstrated. Learning how to do that takes us almost all the way back to the beginning of the computer age, when command languages themselves were a GREAT advance over having to toggle in machine-code instructions, bit-by-bit. How far we've come in a lifetime!
Another helpful option when using ls is to add ”-h” for example: ”ls -lh”. This will give you the list with more ”human readable” numbers for size etc...
1) @0:36 The terminal: Note that all of the examples given require that your system's GUI (graphical user interface) is cooperating. If for some reason your GUI stops responding, or your mouse stop working, you will need an alternative for starting the terminal (which, once started, can be used to trouble-shoot and fix any issues, or to do a clean reboot). There are a few terminals that you can access, that are independent of your GUI. You access them by pressing Ctrl+Alt+F3 (or F4, or F5, etc). Each one will open a terminal. From there, you can run a command to reboot your computer, or any other commands to help identify problems and apply fixes. Pressing Ctrl+Alt+F6 (might differ depending on which Linux distribution you are running), will take you back to your GUI. 2) @12:01 That will copy only files that have a dot (a period symbol). If you have a file named "stuff", then using "cp **.** Pictures" will not include your "stuff" file when the copying takes place. If you really want to copy everything, then use only an asterisk (*). cp * Pictures If you want to see what will be copied, before executing the cp command, then run (for example): ls **.** Whatever "ls" shows you is what will be copied when you, instead of using "ls" you use "cp". 3) @19:44 Yes, issuing some command with the "--help" argument will usually provide documentation on how to use the command. Note: "usually", not "always". Also note that Linux documentation is built around the "man" command (stands for reading the "manual" for a command). So for help on the cp (copy) command, you can use either: cp --help (or) man cp Does it matter? It might. The help that is returned will be similar, but not the same. You might need to run both, in order to have your question(s) answered. Cheers!
I remembered a question from the distant past, when I sat down to study the Linux terminal. for some reason, all linux tutorials never indicate how to create a file on the command line. At first I thought I was imagining it. I flipped through several printed and electronic books, the same thing. All they have answers how to create a directory, how to move or delete, but how to create a new file "test.txt" not. in one place, I remember, I found the command "touch" to create a new file. The lesson is great, the picture, the sequence, the work of the master indeed! Thank you very much! Like and subscribe!)🍻
Thank Christopher Barnatt, you show me a little more of the problems that I was trying to find on the flash drive? Using Linux. The way you explained terminal was like the early computing day with the MS/PC Dos command prompt/symbol, I learn a little faster now. Ol'd them day 1980-1995 when dos/Basic C, C+ was common. B4 Window point and clicks now! Thanks.
Thank you so much for the terminal commands refresher video! As always, I enjoyed watching it, was reminded of things I had forgotten over the years and learned a few things I had previously missed.
You can do amazing things using the terminal. In the 80's we were maintaining a customer list using Vi, a text editor that is very unfriendly to non-geeks(no spreadsheet program on the system). I wrote a simple Bourne script (a script is just a saved text file running the same commands you'd normally enter straight from the keyboard) which gave the user a choice of adding, editing, deleting, or finding a record. The script got the choice, had the user enter the variables it needed, and either appended to a file new line with commas separating the different fields and piping through grep, a program for searching for text in files but much, much more, to create a file without the specified text, or to display every match it found, piped through less in case there was more than a screen full. A little tweaking to bullet proof it and it was done. Another powerful utility is cron, write a script to clean temporary files out, run backups, all types of things and then tell cron day(s) and time(s) to run it. Windows has/had a similar thing, but somewhere about Win 7 it started having security access issues and I gave up on it.
This was a great video, I have been using Linux as my desktop for almost 10 years, started with Ubuntu, then Mint, I now use Manjaro with KDE and love it. That said I picked up a few tricks from this video that I didn't know. Thanks!
Awesome! Thank you for casting a positive light on the command line. There’s so much that could be covered but you pegged the core pretty well. That said, here are some additional things for those interested in diving in a bit more. pwd - this command shows what directory/folder you’re currently in. It can be easy to forget where you are if a distraction occurs. pwd to the rescue! Pressing ctrl-d is another way to quit a terminal if you don’t want to type exit (Ctrl and D held and released together) ls -ltra - this my favorite way to view file listings as it shows all files (hidden too) by reverse date/time order (tr) so the newest appear at the bottom. lsusb - shows all USB devices that are attached and can be very handy to see what’s what. man - this shows extensive help about any command. man ls, man cd, man lsblk, etc. Try one! touch - creates an empty file. For example “touch myfile.txt” created a file named myfile.txt with no content. This can be helpful as you grow in experience with command line. whoami - shows the user account you’re logged in as. While most systems you use you’ll have only one user account, it is possible to change to a different user using the su command. If you troubleshoot Linux systems the whoami command can be a life saver. apt - The apt package management system is robust and, frankly, worth learning the command line for. However, only Linux distros based on Debian will have it. Other distros use different package managers like yum and rpm, so be aware what Linux you’re using. If sudo apt or sudo apt-get shows an unknown error you’re likely no using Debian, Ubuntu, Mint, Raspbian, etc uname -a - this is a quick way to see what system you’re using. Try it grep is a tool to search for text within a file(s) find - this command is very robust and can be confusing with so many options, but here is what I use a lot. find . -name “*.php” -print This find command searches all folders including the current one and below (not above) that have the php extension. The period “.” Is what denotes the current and lower folders. -name is the filename operative and “*.php” says all files with php extension, and -print shows the results. Now, for an advanced trick. You can run a command as a parameter to another command. Enclose the nested command in backward single quote which is usually found to the left of the number 1 key on most keyboards. So, for example, I want to find all php files in my home folder and below that contain my name. grep “Mark” ‘find . -name “*.php” -print’ file - this shows file type. Example, “file someimage.jpg” will show yhe JPEG details. “file myfile.txt” shows ASCII text. This is helpful if you’re not sure what a file is. Two more points and I’ll quit. Be very careful with commands that remove, rename, or move files because if you’re not sure what you’re doing things can get ugly! Lastly, the command line commands like rm, rmdir, and other deleting commands do *not* have an undo feature. There is no trashcan. Once a file or folder is deleted you cannot get it back without special tools or restoring from backup!
sorry if this was mentioned and i missed it, another important thing to point out is that unlike Windows file system (and its own terminal) , in Linux there's a difference between files written with small and capital letters. for example, if you have a directory called ExplaingComputers , you won't be able to access it by cd explainingcmputers
It is good to see command line basics explained, thanks!! Amazing what you can do with command line with the addition of grep, sed & awk tools! It would be great to see a basic demo of these powerful tools at some point. Many think you would need a formal programming language like C or Python to get more complex tasks completed but by using these tools, complex data manipulation and more are very possible with one command line. Thanks again for another great video!! Great to see deeper dives into the complexities of Linux!
Zorin OS has become my standard OS by now, only using Windows when necessary. I am amazed by the increase in speed I experience. Thanks EC for the tip leading me to Zorin!
Also useful: *man bash* -- an exhaustive but dense [edit: like compact / non-verbose] description of your shells capabilities (I assumed bash here. Run "echo $SHELL" to see what's your shell.) Comes handy when you only have a terminal and no Internet connection. Although, reading the man pages online in a browser is often more comfortable. *alias* to define your personal shortcuts (confession: I still use : alias dir="ls -ltrF". Current distributions already provide a *dir* command nowadays to welcome refugees ;-) You might still want to tweak it as you like.) *less* - it's Windows *more* (but less is still more) to page through long outputs (i.e. "ls -l | less" or "dmesg | less"). When working with terminals have a look at *tmux* and *screen* . These are ultra useful when all you have is a terminal (no GUI at all, i.e. on remote logins). They allow you to have multiple terminal sessions within your single terminal and can even make sessions permanent, so after logging out&in you can continue where you left (assuming no reboot happened in between).
man bash is the full Bash manual-all 5000 or so lines of it. It’s also available to read online at www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html
I really love these videos. Very well done and exhaustive. One tip about going back to you home folder: you don't need to actually type the tilde character (~), just type CD and hit return. It will bring you to your home folder anyway. ☺️
Back in 80's and 90's going through college, we used a Unix timeshare system. Red Hat Linux just came out with version 2. You could buy the CDs and booklet at Barnes and Noble. With Windows and Mac OS getting a lot of attention over the past 20-30 years, it's nice to see Linux becoming popular. Like knowing you picked the right OS a long time ago and people are slowly getting into it.
13:01 Probably a good time to mention another useful feature of tab completion, namely if you type a wildcard spec and then press tab once or twice, Bash will show you all the expansions of that wildcard spec, so you can confirm that your command will be acting on what you thought it would be acting on. Another useful trick is to first use the wildcard with something harmless like an “ls” command, to confirm that it only shows the files you want to affect. Then press uparrow to bring the command back, change the “ls” to “rm”, and turn it loose. Because, you know, having suffered the occasional embarrassment of inadvertent deletion or overwriting of files I didn’t mean to over the years, you learn a few tricks for, shall we say, “defensive command-lining” ...
Liked your video very much. I have worked with MSDOS in the early days. So I am not afraid of the terminal. Maybe you could explain more about sudo and how permissions work. Maybe also try to explain the file-system in Linux. It is not so difficult to copy and paste commands in the terminal. But sometimes on the internet you get a lot of mis-information and then you need some skills to recover. But this is very newbie friendly. Thanks for the nice video.
I was actually in a 'terminal' discussion when this video popped up in notifications - I was talking about history in terminal and if chris covered this I missed it.. but my favourite Command Line instruction is history. as you scroll through the results of 'history' you may notice each entry is numbered, so if you type !34 or whatever corresponding number is on the list, you will have actioned that script. Awesome eh.
Linux BASIC command i like it. Since windows 7 ends i want to migrate to Linux permanently. Thank you Mr. Barnatt. I hope will be usefull with the next part of Linux command on the next videos
This is indeed another of those videos that can provide a stepping stone to other things. I am trying to build up a library of them covering such topics.
Thank you Chris for another great presentation , easy to understand visually and audibly . This Tutorial is without doubt a great help for those like myself and others who need reassurance when delving into the Terminal in Linux OS . I thank you again Chris for your contribution in helping the not so savvy Terminal users into gleaning much needed down to Earth information on this subject . Oh and by the way " happy new year " .
In addition to --help, one can also use the command *man* ( for manual? ) in front of an app you need to know more about. Type *man nano* , or *man ifconfig* etc, and *ctrl+z* to exit the manual.
Thank you thank you! This really helps fill in a few of the gaps! I already have a small amount of experience but this was really really helpful. Do as many of these as you can haha.
Interesting! I started a dual boot with Windows a couple years ago and anytime I'm in the terminal I'm just following some step by step instruction. Good to have some more knowledge of how it actually works. Though for basic commands like these the GUI seems easier to me.
One I use a lot is cd ../ Which of course means up one and then down into the directory. I do love the tab key, not a thing in my SCO Unix days. You also could of mentioned that unlike DOS Linux is case sensitive. Maybe part 2 could cover how to write a Bash script, chown, chmod and what the dxwrxwrxwr means. Further on, as Terminal is often used for talking to headless servers, Pi, Odroids wharevers, ssh and sftp from sudo or sudu su. Of course there are other useful commands such as ping, nslookup (old school), dig and ifconfig or IP address. Not to mention traceroute. subtly different to dos tracert. Top, htop, pids, kill, background and foreground, Nano, Pico and vi(m). Hmm maybe the editors should go with scripts. Don't forget Chron ! There is so much fun in the cli. Does it show that I was running ISP servers in the days of Slackware when 1200/300 baud was a thing and our entertainment was us Aussies stealing IRC channels off Texans with eggdrop bots bwahahahaha..
I've been using the Linux/Unix command line since the 90s, but this video reminds me that there's always more to learn - I'd never come across "cd -" before but it's a good shortcut I'll be using in future. Other shortcuts I didn't see in this video are that to get to the home directory you can generally just use cd without any parameters (i.e. cd ~ is the same as simple cd) and to exit a terminal you can use the Ctrl+D shortcut instead of typing exit. My personal preference to see mountpoints is to use df -h which unlike lsblk ignores all un-mounted devices, and additionally lists the total and available capacities of each mounted device making it easier to identify them.
9:47 Worth demonstrating what happens when it cannot find an unambiguous completion: pressing tab the first time will do nothing, pressing it a second time will display available completion candidates. Then you can type some more to narrow the options down, and try again.
Thanks. Over the years I have spent a lot of time working with DOS, and on the odd occasion when I use Linux I often get the commands wrong. This video is very helpful.
Just migrated to Linux Mint. Very happy with its performance and productivity. But of course know nothing about using Terminal:( So this video is exactly what I have been waiting for! Thanks!
Worth it for the Crl-Alt-T shortcut for opening a terminal - thanks. Question: why use "*.*" in your examples? The shell doesn't care about extensions, so just using "*" works.
Excellent tutorial. I wish I had had an instructor like you when I first began working with Unix over 30 years ago. Our class was brief and boring. I learned by reading and on the job training. Later I worked with Sun Solaris and - after we got fed up paying Sun's huge annual maintenance fee - we migrated to Dell servers and CentOS.
Great video. I think the terminal scares a lot of potential new Linux users. Nice to see you explain the basics and show that it's not really that scary. I love working in the terminal, you can do so many cool things with it, especially when you get into writing shell scripts.
Same reason I'm using command prompt in Windows(7)..I re-activated my pirate copy this way the last time Microsoft disabled my "genuine" activation.. 😇
Nice. I'm one of the users who recently migrated from Windows to Mint. This playlist really helps with progressing with my Linux learning. I'm glad for all the gui options as it has helped with the transition, but it's been long enough. I have leaned on the update manager, but i'd like to start using the command terminal and see what is possible. These videos are a good start for me. Ta!
Dispelling the wondrous mysteries of the dreaded terminal. Good video. I've been running various versions of Linux since 2008. I found this to be very helpful.
Chris, thanks very much. As ever, I think you've produced an excellent basic introduction. I expect many of the comments here will add further useful tips and tricks. For example, one thing I use a lot, if I have managed to input an incomplete or incorrect command, is "control-C" to cancel that command.
17:49 That’s assuming you know what command(s) are installed by a package. To see what was actually installed as part of a package, try “dpkg-query -L «package-name»”.
Or just type "dpkg -L package-name" and dpkg passes the -L option and argument to dpkg-query. Saves some typing and having to remember the -query part.
I moved from Windows to Linux and I always keep a pdf of the "Linux Command Line" by William Schotts open. After about a year I am starting to feel comfortable. Going from Windows to linux is a long term commitment but worth it.
The Linux terminal is awesome once you get used to it. You need to set it up properly though, choose a good font and font-size, add some colors to LS and the man-pages, maybe make the command prompt look better if you want to...
A few key additional things missing from the video I think anyone watching this who is new to the Unix/Linux (aka *nix) command line should know: 1. Linux/Unix is a very customizable OS and that also applies to the command line. This means that you can choose your command line interpreters/shells, with BASH (Bourne Again Shell) being the default on most distros but others exist such ZSH (aka Z Shell). Different shells have both similarities and key differences you’ll need to learn. If you stick with the default BASH shell that is the default for the most popular Linux distros as well as the MacOS (which is based on FreeBSD, a Unix variant) then everything you learn in the vid should be pretty much the same, including the default format for the command prompt. Note that some distros as well as some advanced command line users will change the default command line prompt format to something different, such a custom format better suited to the particular needs of that users or what the developer(s) of that though was a better default for the audience the distro is aimed at. The same can apply to the terminal program used to access the command line via the GUI. On MacOS, for example, the default Terminal app has fewer features and customizations vs third party terminal apps like iTerm2.What see in the video is based on the what’s typical of the default terminal app found in popular Linux distros. If your using a system maintained by someone else, they have the option to change the defaults for which command line shell is the default and how the command line looks universally so that all new accounts are given the custom defaults when the account is created. The good news is that you can creat your own customizations that apply only to your own account if you want to go back to the defaults or further modify more to your liking. 2. In addition to customizing the command line prompt, the terminal, or choosing a different command shell, you can also set up special shortcuts to use it the command line known as aliases. An alias in Linux is basically a word/acronym that when entered into the command line will execute a linux command or command line tool. Example: Former DOS users sometimes want to be able to type CLS (stands for Clear Screen) in Linux so that set up an alias that says CLS = Clear so that every time you type CLS linux executes the clear command. You could also setup a shortcut like editor = Emacs so that you could type editor to launch the Emacs text editor. With aliases means sometimes you might find yourself on a another persons system with custom aliases where you enter a command and it does something different then you expect. Just be careful if your using another’s persons machine as even if your using a account created for you, the person may have change the default settings used for new accounts so they not only is there command line customized but so os everyone else’s unless they customize different for their account. 3. When it comes to copy, cut, and paste in a terminal program. All terminals programs have a edit menu that you can use for this purpose in addition to right clicking. You can also typically use keyboard shortcuts but be aware that the keyboards shortcuts for the copy, cut, and paste in the terminal program may not be the typical default used by other programs. For example, ctrl-v copies text in most linux programs that allow text copying but in some terminal programs you may be required to use shift-ctrl-v, for example. You can generally find out what the specific keyboard shortcuts for cut, copy, and paste in your default terminal program is by going to the edit menu where the KB shortcut will listed next to each command. 4. One advantage the command line has in Linux is that you can combine a bunch of commands together in the form of a script file that you can execute via a single command in the command line. For example, I created a BASH script called mkdate that would take screen shots I was saving to a screenshot folder and would put them into a subfolders name with the current date as the name. That way I could execute the script every time I had a bunch of screen shots i wanted organized by date. This saved me from having to creat the folder, then drag and drop all the screenshot files into it as I all had to do was type mkdate into the command line to have the system do that for me. 5. A very important lesson to learn about the Linux command line, which was very breify touched on in the video, is that unlike some others OS’s, Linux by default does not include a lot of warning prompts asking you if your sure you want to do something. This means it is very easy to accidentally delete files, whole directories, etc. without any warning. There are ways to customize the command line prompt so that it ask before it deletes files or directories but some command line experts recommend against that as you could run into the problem where you become reliant on this warning prompt then go use another system that does not have it and accidental delete files on the other system. I personally feel that if your unlikely to be using other’s people computers and feel that having such warning prompts useful to you then turn on the prompts. But be aware that they are not typically on by default thus it is easy to delete stuff you didn’t intend to especially if you use the wildcard charectors *.* (see below if you don’t know what wildcard charecters are). 6. A wildcard character is a symbol, in this case the asterisk, that is used to replace or represent one or more characters. In Linux/Unix, the * represent one or more character while the ? Represent a single character. One way the * wildcard is used is to find or display only files in a directory that start with certain letters such as ls my* which might bring files named mymenu.txt, myjokes,txt, myfavoritefilms.txt, and so forth. Another way it’s used is to delete all files in a directory as shown in the video as *.* represent any file name with any (or no) extension. *.txt on the other hand would only delete text file with the .txt extension. Note that linux does not require file intensions in the way MacOS or Windows does, so certain file types, especially text files and binary application will not have an extension by default (MAcOS and Win apps typically must include the extensions .txt, .app. .exe, etc.). You can however use the ls -l command in Linux to see what extensionless files in a directory are applications vs plain text files. Non-text files will typically have an extension in Linux, as modern Linux apps add one by default for saved files in keeping with the practice started by DOS and Windows and later adopted by the Mac starting with OS X/MacOS, which is also just generally useful in being being able to see at a glance that a file is an image, WP document, HTML file, audio file, etc. even if Linux doesn’t require it to view/load such document/file types the way Windows does. If you do create a text file in Linux that you want to be able to use with Windows then I recommend you manually add the .txt extension (unless the text editor you used does that for you by default) just so Windows knows it’s text file.
When I use the terminal in Linux, I always feel like I really using Linux. Also, I find it easier to use SSH to connect to my Raspberry Pi's terminal to write python programs on it than using my Rii keyboard. Like 5argeTech, I remember the happy days of using MS-DOS on personal computers. Keep up the excellent work you do each week!
18:42 "Do you want to continue? [Y/n]"
The choice in capital letter is the default one, which will be used when simply hitting enter key.
Nice, thanks. You probably just got me an hour or two of extra free time this life.
really? I didn't know that :) This is a great video from Chris and it's comments section.. thanks Marc
But there is a catch!
Sometimes, default choice may not be the right one for you!
So, you still have to read, always ;)
One addition to the above. A lot of bash scripts and programs will have a command line argument that allows unattended install by auto selecting the defaults or by specifying them as an argument on the command line. But, you have to be sure if course ... 😁
also, when running an everyday command such as "apt-get upgrade", end it with -y or -n to skip this step entirely.
Longtime Linux user here. Never heard of "cd -". What a neat trick. Thanks for the tip.
Hey same here! I always wished there was a "back" option for cd and apparently I just found it... I'll be using that a lot :D
see also pushd and popd
U can simply type "cd"
and enter and it will do the same thing
@@tommisgr no it won't, we're talking about `cd -` and I think you're thinking about `cd ~` which look similar but have entirely different functions.
@@tommisgr No, that takes you to your home directory.
So today I decided to finally learn about Linux after 17 years of pure Windows computing... and then this video pops up... the timing couldn't be more perfect
Excellent!
other good channels: joe collins, average linux user, chris titus tech, dorian dot slash, switched to linux, infinitely galactic
there is a brand new FB group for newbies called Penguin Momentum
@@DescendantsOfEnoch thanks a lot!
The ease of navigating by double clicks to access just about anything kept me as a Windows user for 20+ yrs. Recently I've been making many changes to the registry and user account to give myself more control over this operating system that… you know… paid for and own? Microsoft clearly disagrees and feels I need help from myself by denying access to many things and making it literally impossible in some cases to disable software that sends them usage data. Im now a Linux (Arch) user indefinitely now.
As a kali Linux hacker I can say that this video helped to new users using Linux or looking forward to be using it, just a proposition, if someone wants to be anonymous, use Linux becouse it's really secure and they don't steal your information
I've been watching loads of Terminal tutorials over the last couple of days. I should have known that Chris would have the best video out there. Clear, concise and to the point.
I find myself coming away from this video having learnt something instead of watching someone race through their instructions without mentioning their shortcuts.
Been using Linux for months and didn't know half of these. It helps that it's not compulsory to know them since the Mint let's you do many things as you would in Windows, but it's still good to learn.
In my university we have a subject that teaches us how to use the terminal in Linux. Most of the computers run Windows so we need to use a special program, but I just bring my laptop that runs Linux Mint. It's a very interesting subject and the professor who teaches this subject is the best. I'll recommend this video to him to use it in the next year for the next generation of students. Cheers.
Ah, the basics explained in comprehensive detail. Thanks again, Chris!
Thanks! I used to be a Unix user just to run various pieces of equipment around the lab. Now, thanks to the intrusive mandate of all major computer companies I have switched from Windows and Mac to Linux. It's a great refresher and seems much better than the old days ... much appreciated!
That's a great tutorial Chris! There's a couple of points that I'll add, although it's not much.
1) be aware that `sudo apt install` is distro specific, most (all?) debian based distros use apt but other distros use different package managers, for example I'm on arch and use pacman (cool name btw arch people).
2) if you want to remove a directory with files in it, neither rm or rmdir will work: you have to use `rm -r` just like you have to do `cp -r` on directories.
3) running a command on the terminal is basically just running a program. cp is a program, so is rm and mkdir etc. Some programs, like cp and rm only work if they are run from the terminal, but others (for example chromium-browser (guess what that does)) will work either from the terminal or from the GUI.
4) If --help doesn't give enough info, try `man `. Man stands for manual, and it usually gives a very indepth view of the options and some examples.
5) ctrl-d to exit terminal is pretty efficient IMO
They're just a few things I use a lot and thought some people might want to know.
Actually, beginners usually want a very simple explanation, not an in-depth one. Even --help makes an appalling amount of output if all you want is the basics of running the command.
Good post otherwise, tho ...someone must have typed --help in your terminal :)
@@Reziac yes of course but there's both in-depth and also the basics covered in this video, I'm guessing it's aimed at people who aren't _complete_ beginners but they may have used CMD before etc.
That too -- as I mention below, I'm an old DOShead, but still find the linux commandline opaque, so this kind of familiarization is actually quite helpful.
@@KingJellyfishII Well, if you just installed a linux distro on your computer, you're not a "complete beginner". Your input is very much appreciated.
Linux ppl r gr8t.
I am new in the Linux world, just 3/4 days old. I find your video very valuable and knowledgeable. Thanks for your time in making the video a very useful one to all like me. I really love your clear pronunciation.
Glad to help!
The command line is what one needs to master to go beyond ‘skin deep’. Thanks for the video, Chris!
100% in agreement Arun ji
Yes. The command line will get you balls deep
It's also the quickest way to install things, like sudo apt install firefox;) But you can also bork your system as I found out myself.
The command line is a rabbit hole and one can never forget its ease once one gets used to it, even for basic file navigation.
The terminal might seem scary at first, but it doesn't have to be. It's pretty easy to learn the basics, and it can make doing certain tasks easier. If you're looking to learn more about the Linux terminal, Joe Collins made a fantastic video which teaches you all the basics I definitely recommend.
This is why I watch your channel. This. You, sir, are thoughtful and generous and patient. I knew all this, but it has been taught well and with the proper pace. Awesome!
Thanks.
This is a good basic foundation to the linux terminal command line. Watch this video 10 times. There's a lot of information to take away from this, but Chris is only scratching the surface, and there is so much more you can do.This is where the real magic happens. I would encourage anyone to use only the command line for a week. I learned Unix in the 70's out of a manual before I had access to a computer, so you can learn this too. Linux is very closely related to Unix. If you know one. You pretty much know the other. I don't see a link to a linux tutorial here, but there are many out there on Amazon.
The Terminal is Power...
I still remember the early days of MSDOS.
PC's before windows.
The command line was king!
MSDOS like windows is a rip off of Unix or *Nix to those in the know. DOS or even powershell have anything on the early shells eshell cshell let alone ash or bash. I thankfully skipped the need for dos/windows since I was brought up on SCO ( true SCO ) and Solaris.
@@sethrd999 I use Linux as my everyday OS.
@@Kensownvids Which again is a rip off from Unix
@@Kensownvids Gary Kildall, the creator of CP/M.. Remember Computer Chronicles on PBS? :)
@@5argetech56 Me to all the way back from Slackware ( yes the first Linux distro ( a floppy disc ) .. I used to have various SGi kits also ( pizza boxes ) that had irix on them.
As a Systems Engineer, I work with both Windows and Linux machines, mostly servers. I'd recommend anyone who uses Linux to jump into using the Terminal, much as I advise people using CMD Prompt or better still, Powershell on a Windows box. Great tutorial for the novice Linux user!
11:50 It may be instinctive to MS-DOS-experienced users to type “*.*”, but remember such a wildcard will only match names with a dot in them. To match all names, type “*”.
Nice tutorial and I noticed this too! Indeed, the concept of a file extension as a separate "field" of a filename doesn't really exist in Linux at the CLI. It may be a convenience in recognizing the type of data if one makes a name ending in dot-something (or for the gui file manager which maintains application associations). Maybe it's due to this that there is the `file` command which can deduce what kind of file one is seeing even if there is no extension there. Also, while some commands do support --help or maybe -? or -h (linux not always the most consistent!), there is usually more complete help with the man (manual) command. Hopefully viewers are inspired to explore more around the command line!
Yeah, but that will also catch directories.
@@encycl07pedia- Either one can. Directories can have dots in their names. such as /etc/fonts/conf.d.
@@lawrencedoliveiro9104 Yes, but those are far less common. Who puts dots in their folder names?
I mean "rmdir dir" and "rm -rf dir" can both delete directories, but one is considerably safer than the other by default.
@@encycl07pedia- Rather common, actually, particularly among system directories. On my Debian system, the command
find /etc -type d -name \*.\* | wc -l
finds 216 of them.
Outstanding Terminal video .... One of the best introductory videos to Terminal.
Thanks for this feedback, most appreciated. :)
Been a linux user for quite a while. Still learned lots from this video. Absolutely fantastic teaching.
I just moved over to Ubuntu from windows about a week ago. I’ve been using the terminal a fair amount since installing Ubuntu, mostly for installing packages. Your tutorial has made my life so much easier now that I know the shortcuts and how to navigate through my files. Thank you!
Great to hear!
Last week I took with me the old core2duo pc my grandmother used, since she recently bought a laptop. I installed Mint over Windows 10 (it ran so slowly) with the intention to give it away, but now I'm using it as my main machine: I've been inadvertently converted!
Great story. Linux can so often revitalize an older PC.
That's cool dude! It's amazing how much faster computers can feel with linux.
Thanks Frank. I've also found that many old PC's run horribly slowly with Windows 10 but run much faster with Linux, for example MX or Xfce versions of Mint (etc....).
I had the same experience with LXLE Linux who works so much faster than Windows 10 on an old Celeron PC.
In 21 minutes you’ve explained the basics far better than some videos that are hours long. I wanted to learn Linux because of the terminal and not in spite of it, I used to enjoy using MSDOS and XTree gold when they were real programs.
I took a course in CLI Linux a year ago. Six months later I've almost forgotten half of it. :( You really have to keep practicing these things.
This is so true -- knowledge that is not excercised somehow drains from our skulls. I sometimes have to go back to my own videos (or scripts therefore) to check what I "know" about something! :)
It's worth noting early that Linux directory and file names are case sensitive. You MUST get the capitalization right.
Yeah, but that's why you shouldn't have dirs with capitals... or filenames with capitals...
@@encycl07pedia- unless duplicate names but not content
@@ericscaillet2232 You shouldn't duplicate names like that. It's just asking for problems and confusion, especially when copying between filesystems. You're very likely to wipe one of the folders/files out.
I love using the Linux terminal for the most part. It brings me back to the days where DOS was the primary OS and windows was just a program
You got a like from me for one reason alone. I had always thought the progression was aptitude, shortened to apt, then, to avoid confusion GET was added to show what apt did when run, for Windows dummies like me....I had NO IDEA that apt was newer than apt-get. You learn something new everyday....
I've been using UNIX/Linux for 3 years. I've learned quite a lot from this tutorial. thank you
Bro I swear you are out of a comic book or cartoon you fit the persona of a nerd so well. I like your videos, well put together and informative!
It's been decades since I really worked on a computer from the command line interface (in the context of using a PC), probably 1993, and yet I can still remember learning MS-DOS before then, at school, and continuing in computer training.
I might get a book on Linux as I intend to re-purpose an older PC as a Linux machine.
I learned four new things today:
1. 'cd -' to return to prior directory.
2. rmdir, which is a safer way to remove empty directories than 'rm -r' because it fails if a directory isn't empty.
3. lsblk, which is a more convenient way to determine if a drive/partition is present than ls /dev/sd(expected drive letter)* for those of us who don't allow partitions to automatically mount.
4. Unlike df, lsblk does not need to be run as root to display mountpoint paths that a user without the appropriate permissions would not normally be able to see.
Yet another timely video with the end of Windows 7 support earlier this week, very well explained Chris and makes the whole process seem much easier than many Windows users would have expected.
I learned more in 20 min here than all my attempts at books and texts on the subject. Thank you so much - excellent! Need to re-watch and tale some notes now.
Great to hear. :)
CTL + l (that’s a lowercase L) is also an alternate to typing in the clear command.
Correct, and to exit the terminal shell, the shortcut is Ctrl-D. The case does not matter for these shortcuts. In days of yore, a terminal was a large, noisy electromechanical machine called a Teletype, the classic model being ASR-33. These machines could only print capital letters.
Kenny Luba - That's the kind of futile detail that Linux users love to throw at newbies. Maybe to create confusion or to brag about their superior knowledge of Linux.
Sadly Ctrl+L (or clear) only scrolls the terminal, and doesn't remove the lines above it from the screen.
@@cybair9341 And your comment is unnecessarily aggressive and so typical of what is seen all over TH-cam comments and on social media these days.
@@RandomNullpointer Well, it dates back to the days of teletypes. You can't erase what's printed on paper so to 'clear' it you issue a formfeed to eject the current page of continuous stationery (fan-fold paper) and start at the top of a new page.
As a full-time Linux user I must say thanks for the terminal primer. Got be remind about some of back door stuff via the terminal.
Thanks for a great intro tutorial on the Linux terminal! As someone looking for an alternative to the ever more intrusive and restrictive Windows OS this is very helpful. With each new version of Windows we know even less about what's going on under the hood, not to mention how much Microsoft is spying on users of their bloated operating system.
There is something very satisfying about learning to use the cli and linux in general. I know a fair bit about the shell but it never hurts to brush up and this channel is always a reliable source of useful information that I never have to point out corrections or criticise the fact checking.
The comments are a continuation of this lesson! I am inspired, and I thank all of you who enjoy sharing your knowledge, and not looking down on beginners. We all had to crawl before we walked people. Thank you ALL, especially Chris for starting this information filled basic lesson. I have found it the most exciting place to begin out of all the stuff I've been learning.
Hmm, there's room for improvement.
1) Copy and paste with the terminal is annoyingly much work, but there's a other way that's usually far quicker and has worked on every Linux distro I've used: Just mark the text, it gets automatically moved into a copy buffer, and then anywhere you press your middle mouse key it gets pasted (I. E. The terminal).
2) like others mentioned `apt` is a distro specific command, that's something you should've mentioned
3) also like others mentioned you could've shown `man [cmd]` too
4) while we're speaking of that, another command I find pretty helpful from time to time is `apropos [keyword]`, that one searches all the documents you get shown with `man` (called manpages). That helps you find a commands name if you can only remember what it does, or if you want to find a new command
4) there's autocomplete, and then there's autocomplete suggestions, which in my setup is called when I press tab twice, that's very helpful if you're writing a long directory and can't remember it precisely
5) also the generic nature of `- - help`, where you can often use it on subcommands like `apt install - - help`
I tried here to cover things for beginners; knowing what to leave out is as important as what is included. Not every mouse has a middle button! And doing things with a mouse button click is not good in video, as the viewer cannot see what you are doing.
Thank you Samuel, I didn't know about middle mouse key, must remember that one. :)
Middle mouse button can be pressing the scroll wheel?
In fact, in this video you are not using a Terminal but a Pseudo Terminal Slave (PTS). It is just an emulated Terminal. This emulation is done by Terminal Emulators like Xterm. The real Terminal is a TeleTYpe writer (TTY). It is accessible from the Ctrl + Alt + F shortcut. In order to know if you are currently using a PTS or a TTY, type the 'tty' command. I know that the word Terminal is commonly used for PTS so it is acceptable for novice users but I had to explain that for expert users. By the way, great video as always, the basics are explained perfectly.
At the start of the video I do say that I am using a terminal emulator. But pragramtically, I then use the term "terminal"
There is no need to explain it to the experts as we are aware but this is aimed at noobs who wanne become. This is trivial for them at this point in their learning curve. They are not gonna hop TTY for at least another year at this stage and this might only confuse them more.
The 'cd' command without arguments will also return you to your home directory. The 'clear' command can also be done as Ctrl-L, as well. Handy little shortcuts that turn up over time.
Ah, thanks. I will remember Ctrl-L. :)
I moved to Linux about 4 years ago and have never looked back. The CLI or terminal is immensely powerful and useful particularly for bulk file wrangling activities. I now use the terminal for everything from resizing photos, converting RAWs to PNGs masses of things with AV content in FFMPEG, old drive restoration with powerful disc tools plus bash scripting and so much more. I even browse Google with Googler in the terminal!
Sudo install ExplainingComputers...
:)
You should turn your website into a desktop app and add it to Debian repository to make sure it works :)
Sorry to be that guy but `sudo apt install ExplainingComputers`
@@KingJellyfishII Thanks...lol
*+Алексей* second that.
i've been suggesting that on a couple of videos.
or even the less exhausting Patreon type route.
but seems Chris Sir is a one many army and with other real life work
there's only so much he might be getting time to tidy things up.
although it doesn't cost that exorbitantly to get someone to create phone or PC applications.. still it's a cost and ..finding the right people.. who remain invested (mentality) invested.. over 2-3 years to iron things out.
.. that's a bit tough.
unless we all, those with relevant skills, resources chip in too.
Wonderful demonstration of the Linux command language. Everybody who uses a computer should at least be aware that such a thing exists. Knowing how to use it gives us more "direct control" over our devices. My first computer in 1978 used the long-defunct CP/M operating system, and the first IBM PC used MS-DOS, which was an outright rip-off of CP/M. Both CP/M and MS-DOS used only their command languages, since in those days there were no graphical user interfaces like Windows. People now have no idea how useful computers could be using only command languages. In fact, those interactive command languages were themselves a GREAT advance over their "main-frame" computer predecessors JCL (Job Control Language), which were typically commands that had been "key-punched" onto punch card decks so they could be run repetitively using computer card readers as input devices. There were also keyboard computer control consoles where official "computer operators" would often enter commands themselves, one by one. Those console commands were the predecessors of the computer command languages, such as the Linux "terminal" command lines you have demonstrated. Learning how to do that takes us almost all the way back to the beginning of the computer age, when command languages themselves were a GREAT advance over having to toggle in machine-code instructions, bit-by-bit. How far we've come in a lifetime!
Another helpful option when using ls is to add ”-h” for example: ”ls -lh”. This will give you the list with more ”human readable” numbers for size etc...
The GUI makes easy things easy, the command line makes difficult things easy. I always have at least one terminal open. Great video!
1)
@0:36
The terminal:
Note that all of the examples given require that your system's GUI (graphical user interface) is cooperating.
If for some reason your GUI stops responding, or your mouse stop working, you will need an alternative for starting the terminal (which, once started, can be used to trouble-shoot and fix any issues, or to do a clean reboot).
There are a few terminals that you can access, that are independent of your GUI. You access them by pressing Ctrl+Alt+F3 (or F4, or F5, etc).
Each one will open a terminal. From there, you can run a command to reboot your computer, or any other commands to help identify problems and apply fixes.
Pressing Ctrl+Alt+F6 (might differ depending on which Linux distribution you are running), will take you back to your GUI.
2)
@12:01
That will copy only files that have a dot (a period symbol).
If you have a file named "stuff", then using "cp **.** Pictures" will not include your "stuff" file when the copying takes place.
If you really want to copy everything, then use only an asterisk (*).
cp * Pictures
If you want to see what will be copied, before executing the cp command, then run (for example):
ls **.**
Whatever "ls" shows you is what will be copied when you, instead of using "ls" you use "cp".
3)
@19:44
Yes, issuing some command with the "--help" argument will usually provide documentation on how to use the command.
Note: "usually", not "always".
Also note that Linux documentation is built around the "man" command (stands for reading the "manual" for a command).
So for help on the cp (copy) command, you can use either:
cp --help
(or)
man cp
Does it matter?
It might.
The help that is returned will be similar, but not the same.
You might need to run both, in order to have your question(s) answered.
Cheers!
I remembered a question from the distant past, when I sat down to study the Linux terminal. for some reason, all linux tutorials never indicate how to create a file on the command line. At first I thought I was imagining it. I flipped through several printed and electronic books, the same thing. All they have answers how to create a directory, how to move or delete, but how to create a new file "test.txt" not. in one place, I remember, I found the command "touch" to create a new file. The lesson is great, the picture, the sequence, the work of the master indeed! Thank you very much! Like and subscribe!)🍻
Thank Christopher Barnatt, you show me a little more of the problems that I was trying to find on the flash drive? Using Linux. The way you explained terminal was like the early computing day with the MS/PC Dos command prompt/symbol, I learn a little faster now. Ol'd them day 1980-1995 when dos/Basic C, C+ was common. B4 Window point and clicks now! Thanks.
Thank you so much for the terminal commands refresher video! As always, I enjoyed watching it, was reminded of things I had forgotten over the years and learned a few things I had previously missed.
You can do amazing things using the terminal. In the 80's we were maintaining a customer list using Vi, a text editor that is very unfriendly to non-geeks(no spreadsheet program on the system). I wrote a simple Bourne script (a script is just a saved text file running the same commands you'd normally enter straight from the keyboard) which gave the user a choice of adding, editing, deleting, or finding a record. The script got the choice, had the user enter the variables it needed, and either appended to a file new line with commas separating the different fields and piping through grep, a program for searching for text in files but much, much more, to create a file without the specified text, or to display every match it found, piped through less in case there was more than a screen full. A little tweaking to bullet proof it and it was done.
Another powerful utility is cron, write a script to clean temporary files out, run backups, all types of things and then tell cron day(s) and time(s) to run it. Windows has/had a similar thing, but somewhere about Win 7 it started having security access issues and I gave up on it.
This was a great video, I have been using Linux as my desktop for almost 10 years, started with Ubuntu, then Mint, I now use Manjaro with KDE and love it.
That said I picked up a few tricks from this video that I didn't know. Thanks!
Awesome! Thank you for casting a positive light on the command line. There’s so much that could be covered but you pegged the core pretty well. That said, here are some additional things for those interested in diving in a bit more.
pwd - this command shows what directory/folder you’re currently in. It can be easy to forget where you are if a distraction occurs. pwd to the rescue!
Pressing ctrl-d is another way to quit a terminal if you don’t want to type exit (Ctrl and D held and released together)
ls -ltra - this my favorite way to view file listings as it shows all files (hidden too) by reverse date/time order (tr) so the newest appear at the bottom.
lsusb - shows all USB devices that are attached and can be very handy to see what’s what.
man - this shows extensive help about any command. man ls, man cd, man lsblk, etc. Try one!
touch - creates an empty file. For example “touch myfile.txt” created a file named myfile.txt with no content. This can be helpful as you grow in experience with command line.
whoami - shows the user account you’re logged in as. While most systems you use you’ll have only one user account, it is possible to change to a different user using the su command. If you troubleshoot Linux systems the whoami command can be a life saver.
apt - The apt package management system is robust and, frankly, worth learning the command line for. However, only Linux distros based on Debian will have it. Other distros use different package managers like yum and rpm, so be aware what Linux you’re using. If sudo apt or sudo apt-get shows an unknown error you’re likely no using Debian, Ubuntu, Mint, Raspbian, etc
uname -a - this is a quick way to see what system you’re using. Try it
grep is a tool to search for text within a file(s)
find - this command is very robust and can be confusing with so many options, but here is what I use a lot.
find . -name “*.php” -print
This find command searches all folders including the current one and below (not above) that have the php extension. The period “.” Is what denotes the current and lower folders. -name is the filename operative and “*.php” says all files with php extension, and -print shows the results.
Now, for an advanced trick. You can run a command as a parameter to another command. Enclose the nested command in backward single quote which is usually found to the left of the number 1 key on most keyboards.
So, for example, I want to find all php files in my home folder and below that contain my name.
grep “Mark” ‘find . -name “*.php” -print’
file - this shows file type. Example, “file someimage.jpg” will show yhe JPEG details. “file myfile.txt” shows ASCII text. This is helpful if you’re not sure what a file is.
Two more points and I’ll quit.
Be very careful with commands that remove, rename, or move files because if you’re not sure what you’re doing things can get ugly!
Lastly, the command line commands like rm, rmdir, and other deleting commands do *not* have an undo feature. There is no trashcan. Once a file or folder is deleted you cannot get it back without special tools or restoring from backup!
Great post -- thanks for sharing.
To answer your closing statement, I did find this useful...you’re a very good instructor. Thanks!
I switched from Windows 7 to Linux Mint. This will speed up the learning curve a lot! Thanks a million Chris.
sorry if this was mentioned and i missed it, another important thing to point out is that unlike Windows file system (and its own terminal) , in Linux there's a difference between files written with small and capital letters. for example, if you have a directory called ExplaingComputers , you won't be able to access it by cd explainingcmputers
Very good point -- I should have mentioned this.
Incredibly useful summary. You have explained more in a few minutes than I have absorbed trawling through pages of text in trying to learn.
It is good to see command line basics explained, thanks!! Amazing what you can do with command line with the addition of grep, sed & awk tools! It would be great to see a basic demo of these powerful tools at some point. Many think you would need a formal programming language like C or Python to get more complex tasks completed but by using these tools, complex data manipulation and more are very possible with one command line. Thanks again for another great video!! Great to see deeper dives into the complexities of Linux!
Zorin OS has become my standard OS by now, only using Windows when necessary. I am amazed by the increase in speed I experience. Thanks EC for the tip leading me to Zorin!
Thanks for sharing your experience. Another Linux convert! :)
Also useful:
*man bash* -- an exhaustive but dense [edit: like compact / non-verbose] description of your shells capabilities (I assumed bash here. Run "echo $SHELL" to see what's your shell.) Comes handy when you only have a terminal and no Internet connection. Although, reading the man pages online in a browser is often more comfortable.
*alias* to define your personal shortcuts (confession: I still use : alias dir="ls -ltrF". Current distributions already provide a *dir* command nowadays to welcome refugees ;-) You might still want to tweak it as you like.)
*less* - it's Windows *more* (but less is still more) to page through long outputs (i.e. "ls -l | less" or "dmesg | less").
When working with terminals have a look at *tmux* and *screen* . These are ultra useful when all you have is a terminal (no GUI at all, i.e. on remote logins). They allow you to have multiple terminal sessions within your single terminal and can even make sessions permanent, so after logging out&in you can continue where you left (assuming no reboot happened in between).
man bash is the full Bash manual-all 5000 or so lines of it. It’s also available to read online at www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html
I really love these videos. Very well done and exhaustive.
One tip about going back to you home folder: you don't need to actually type the tilde character (~), just type CD and hit return.
It will bring you to your home folder anyway. ☺️
Even on topics for which I have some expertise, I always enjoy your videos. Happy New Year Chris.
A Happy New Year! :)
Back in 80's and 90's going through college, we used a Unix timeshare system. Red Hat Linux just came out with version 2. You could buy the CDs and booklet at Barnes and Noble. With Windows and Mac OS getting a lot of attention over the past 20-30 years, it's nice to see Linux becoming popular. Like knowing you picked the right OS a long time ago and people are slowly getting into it.
13:01 Probably a good time to mention another useful feature of tab completion, namely if you type a wildcard spec and then press tab once or twice, Bash will show you all the expansions of that wildcard spec, so you can confirm that your command will be acting on what you thought it would be acting on.
Another useful trick is to first use the wildcard with something harmless like an “ls” command, to confirm that it only shows the files you want to affect. Then press uparrow to bring the command back, change the “ls” to “rm”, and turn it loose.
Because, you know, having suffered the occasional embarrassment of inadvertent deletion or overwriting of files I didn’t mean to over the years, you learn a few tricks for, shall we say, “defensive command-lining” ...
This is one of the best tutorials. Chris is the best teacher on TH-cam
Thanks! :)
Liked your video very much. I have worked with MSDOS in the early days. So I am not afraid of the terminal. Maybe you could explain more about sudo and how permissions work. Maybe also try to explain the file-system in Linux.
It is not so difficult to copy and paste commands in the terminal. But sometimes on the internet you get a lot of mis-information and then you need some skills to recover.
But this is very newbie friendly. Thanks for the nice video.
I was actually in a 'terminal' discussion when this video popped up in notifications - I was talking about history in terminal and if chris covered this I missed it.. but my favourite Command Line instruction is history. as you scroll through the results of 'history' you may notice each entry is numbered, so if you type !34 or whatever corresponding number is on the list, you will have actioned that script. Awesome eh.
I love your channel, always so much useful information, I'm new to linux and the terminal is still a mystery to me
Linux BASIC command i like it. Since windows 7 ends i want to migrate to Linux permanently. Thank you Mr. Barnatt. I hope will be usefull with the next part of Linux command on the next videos
This is indeed another of those videos that can provide a stepping stone to other things. I am trying to build up a library of them covering such topics.
ExplainingComputers yes Mr. Barnatt. I like the way you explain how to use Linux command. Step by step with Example thank you so much
Thank you Chris for another great presentation , easy to understand visually and audibly . This Tutorial is without doubt a great help for those like myself and others who need reassurance when delving into the Terminal in Linux OS . I thank you again Chris for your contribution in helping the not so savvy Terminal users into gleaning much needed down to Earth information on this subject .
Oh and by the way " happy new year " .
A Happy New Year!
In addition to --help, one can also use the command *man* ( for manual? ) in front of an app you need to know more about.
Type *man nano* , or *man ifconfig* etc, and *ctrl+z* to exit the manual.
Thank you thank you!
This really helps fill in a few of the gaps! I already have a small amount of experience but this was really really helpful.
Do as many of these as you can haha.
Interesting! I started a dual boot with Windows a couple years ago and anytime I'm in the terminal I'm just following some step by step instruction. Good to have some more knowledge of how it actually works. Though for basic commands like these the GUI seems easier to me.
One I use a lot is cd ../ Which of course means up one and then down into the directory. I do love the tab key, not a thing in my SCO Unix days. You also could of mentioned that unlike DOS Linux is case sensitive. Maybe part 2 could cover how to write a Bash script, chown, chmod and what the dxwrxwrxwr means. Further on, as Terminal is often used for talking to headless servers, Pi, Odroids wharevers, ssh and sftp from sudo or sudu su. Of course there are other useful commands such as ping, nslookup (old school), dig and ifconfig or IP address. Not to mention traceroute. subtly different to dos tracert. Top, htop, pids, kill, background and foreground, Nano, Pico and vi(m).
Hmm maybe the editors should go with scripts.
Don't forget Chron !
There is so much fun in the cli. Does it show that I was running ISP servers in the days of Slackware when 1200/300 baud was a thing and our entertainment was us Aussies stealing IRC channels off Texans with eggdrop bots bwahahahaha..
Oh wow, you just made me remember when learning how to use DOS at school! Happy days!
Finally someone explained from the basic for new users
Normally videos skip the small details and which is indeed confusing
Learn Linux now boys. There are veiled whispers speaking of Windows turning into a subscription based service.
I've been using the Linux/Unix command line since the 90s, but this video reminds me that there's always more to learn - I'd never come across "cd -" before but it's a good shortcut I'll be using in future.
Other shortcuts I didn't see in this video are that to get to the home directory you can generally just use cd without any parameters (i.e. cd ~ is the same as simple cd) and to exit a terminal you can use the Ctrl+D shortcut instead of typing exit.
My personal preference to see mountpoints is to use df -h which unlike lsblk ignores all un-mounted devices, and additionally lists the total and available capacities of each mounted device making it easier to identify them.
9:47 Worth demonstrating what happens when it cannot find an unambiguous completion: pressing tab the first time will do nothing, pressing it a second time will display available completion candidates. Then you can type some more to narrow the options down, and try again.
Thanks. Over the years I have spent a lot of time working with DOS, and on the odd occasion when I use Linux I often get the commands wrong. This video is very helpful.
Great stuff. Would love to see more terminal use videos. Very helpful and easily to keep up with your explanations.
Just migrated to Linux Mint. Very happy with its performance and productivity. But of course know nothing about using Terminal:( So this video is exactly what I have been waiting for! Thanks!
Worth it for the Crl-Alt-T shortcut for opening a terminal - thanks.
Question: why use "*.*" in your examples? The shell doesn't care about extensions, so just using "*" works.
Excellent tutorial. I wish I had had an instructor like you when I first began working with Unix over 30 years ago. Our class was brief and boring. I learned by reading and on the job training. Later I worked with Sun Solaris and - after we got fed up paying Sun's huge annual maintenance fee - we migrated to Dell servers and CentOS.
Great video. I think the terminal scares a lot of potential new Linux users. Nice to see you explain the basics and show that it's not really that scary. I love working in the terminal, you can do so many cool things with it, especially when you get into writing shell scripts.
Same reason I'm using command prompt in Windows(7)..I re-activated my pirate copy this way the last time Microsoft disabled my "genuine" activation.. 😇
Nice. I'm one of the users who recently migrated from Windows to Mint. This playlist really helps with progressing with my Linux learning. I'm glad for all the gui options as it has helped with the transition, but it's been long enough. I have leaned on the update manager, but i'd like to start using the command terminal and see what is possible. These videos are a good start for me.
Ta!
Good luck with Linux! It sounds like you are digging in just fine.
...Fantastic video! It took some of the mystery out of the terminal for me!
Dispelling the wondrous mysteries of the dreaded terminal. Good video. I've been running various versions of Linux since 2008. I found this to be very helpful.
Thanks for the video as always Chris, I've liked while watching.. I know it will be as quality as always. atb for 2020 amigo. ty
Thanks Paul.
Chris, thanks very much. As ever, I think you've produced an excellent basic introduction.
I expect many of the comments here will add further useful tips and tricks.
For example, one thing I use a lot, if I have managed to input an incomplete or incorrect command, is "control-C" to cancel that command.
When I clicked on this video, everything was powers of 2. 2048 views, 256 likes, 2 dislikes.
Spooky . . .
It knew that it was about computer stuff LMAO
@@KingJellyfishII Even some commenters are powers of 2!
@@SugarBeetMC yeah I wonder who named their channel after their favourite power of two... Lol
I gave your comment the 16th like.
Seeing how similar this is to MS-DOS (that I used a bit as a kid) is making me feel a whole lot better in thinking of switching over to Linux
17:49 That’s assuming you know what command(s) are installed by a package. To see what was actually installed as part of a package, try “dpkg-query -L «package-name»”.
Or just type "dpkg -L package-name" and dpkg passes the -L option and argument to dpkg-query. Saves some typing and having to remember the -query part.
I moved from Windows to Linux and I always keep a pdf of the "Linux Command Line" by William Schotts open. After about a year I am starting to feel comfortable. Going from Windows to linux is a long term commitment but worth it.
The Linux terminal is awesome once you get used to it. You need to set it up properly though, choose a good font and font-size, add some colors to LS and the man-pages, maybe make the command prompt look better if you want to...
Yes, there is so much you can customize -- the user can be in control! :)
A few key additional things missing from the video I think anyone watching this who is new to the Unix/Linux (aka *nix) command line should know:
1. Linux/Unix is a very customizable OS and that also applies to the command line. This means that you can choose your command line interpreters/shells, with BASH (Bourne Again Shell) being the default on most distros but others exist such ZSH (aka Z Shell). Different shells have both similarities and key differences you’ll need to learn. If you stick with the default BASH shell that is the default for the most popular Linux distros as well as the MacOS (which is based on FreeBSD, a Unix variant) then everything you learn in the vid should be pretty much the same, including the default format for the command prompt. Note that some distros as well as some advanced command line users will change the default command line prompt format to something different, such a custom format better suited to the particular needs of that users or what the developer(s) of that though was a better default for the audience the distro is aimed at. The same can apply to the terminal program used to access the command line via the GUI. On MacOS, for example, the default Terminal app has fewer features and customizations vs third party terminal apps like iTerm2.What see in the video is based on the what’s typical of the default terminal app found in popular Linux distros. If your using a system maintained by someone else, they have the option to change the defaults for which command line shell is the default and how the command line looks universally so that all new accounts are given the custom defaults when the account is created. The good news is that you can creat your own customizations that apply only to your own account if you want to go back to the defaults or further modify more to your liking.
2. In addition to customizing the command line prompt, the terminal, or choosing a different command shell, you can also set up special shortcuts to use it the command line known as aliases. An alias in Linux is basically a word/acronym that when entered into the command line will execute a linux command or command line tool. Example: Former DOS users sometimes want to be able to type CLS (stands for Clear Screen) in Linux so that set up an alias that says CLS = Clear so that every time you type CLS linux executes the clear command. You could also setup a shortcut like editor = Emacs so that you could type editor to launch the Emacs text editor. With aliases means sometimes you might find yourself on a another persons system with custom aliases where you enter a command and it does something different then you expect. Just be careful if your using another’s persons machine as even if your using a account created for you, the person may have change the default settings used for new accounts so they not only is there command line customized but so os everyone else’s unless they customize different for their account.
3. When it comes to copy, cut, and paste in a terminal program. All terminals programs have a edit menu that you can use for this purpose in addition to right clicking. You can also typically use keyboard shortcuts but be aware that the keyboards shortcuts for the copy, cut, and paste in the terminal program may not be the typical default used by other programs. For example, ctrl-v copies text in most linux programs that allow text copying but in some terminal programs you may be required to use shift-ctrl-v, for example. You can generally find out what the specific keyboard shortcuts for cut, copy, and paste in your default terminal program is by going to the edit menu where the KB shortcut will listed next to each command.
4. One advantage the command line has in Linux is that you can combine a bunch of commands together in the form of a script file that you can execute via a single command in the command line. For example, I created a BASH script called mkdate that would take screen shots I was saving to a screenshot folder and would put them into a subfolders name with the current date as the name. That way I could execute the script every time I had a bunch of screen shots i wanted organized by date. This saved me from having to creat the folder, then drag and drop all the screenshot files into it as I all had to do was type mkdate into the command line to have the system do that for me.
5. A very important lesson to learn about the Linux command line, which was very breify touched on in the video, is that unlike some others OS’s, Linux by default does not include a lot of warning prompts asking you if your sure you want to do something. This means it is very easy to accidentally delete files, whole directories, etc. without any warning. There are ways to customize the command line prompt so that it ask before it deletes files or directories but some command line experts recommend against that as you could run into the problem where you become reliant on this warning prompt then go use another system that does not have it and accidental delete files on the other system. I personally feel that if your unlikely to be using other’s people computers and feel that having such warning prompts useful to you then turn on the prompts. But be aware that they are not typically on by default thus it is easy to delete stuff you didn’t intend to especially if you use the wildcard charectors *.* (see below if you don’t know what wildcard charecters are).
6. A wildcard character is a symbol, in this case the asterisk, that is used to replace or represent one or more characters. In Linux/Unix, the * represent one or more character while the ? Represent a single character. One way the * wildcard is used is to find or display only files in a directory that start with certain letters such as ls my* which might bring files named mymenu.txt, myjokes,txt, myfavoritefilms.txt, and so forth. Another way it’s used is to delete all files in a directory as shown in the video as *.* represent any file name with any (or no) extension. *.txt on the other hand would only delete text file with the .txt extension. Note that linux does not require file intensions in the way MacOS or Windows does, so certain file types, especially text files and binary application will not have an extension by default (MAcOS and Win apps typically must include the extensions .txt, .app. .exe, etc.). You can however use the ls -l command in Linux to see what extensionless files in a directory are applications vs plain text files. Non-text files will typically have an extension in Linux, as modern Linux apps add one by default for saved files in keeping with the practice started by DOS and Windows and later adopted by the Mac starting with OS X/MacOS, which is also just generally useful in being being able to see at a glance that a file is an image, WP document, HTML file, audio file, etc. even if Linux doesn’t require it to view/load such document/file types the way Windows does. If you do create a text file in Linux that you want to be able to use with Windows then I recommend you manually add the .txt extension (unless the text editor you used does that for you by default) just so Windows knows it’s text file.
Thanks for this -- but this was already a long video! :)
10:33 you could also do "rm -rf "
When I use the terminal in Linux, I always feel like I really using Linux. Also, I find it easier to use SSH to connect to my Raspberry Pi's terminal to write python programs on it than using my Rii keyboard.
Like 5argeTech, I remember the happy days of using MS-DOS on personal computers. Keep up the excellent work you do each week!
Ah, I new taking a look at the site would yeild a new video!
And I just got a notification for this video, and I am five minutes in...
TH-cam, please don't change... 😂
great channel. I'm from Brazil and I needed a channel like this !! congratulations!