The reason the cat command writes stuff after you press ctrl+c is that you're using pipes. Pipes route data from one program to the next in a line by line fashion. When you pressed enter, you started a new line and the line you just finished was passed down the pipe and written to the file. The Ctrl+C just cancels the operation with submitting any more data. Ctrl+D finishes input and also sends the text on the current line down the pipe. This is also why you can't return to the previous line to edit it. The data has already been sent. You can also see this by piping a file. For example, test.txt contains: This is a test Line 2 Line 3 Running the following command gives: $ cat test.txt | xargs -I{} echo "{} EOL" >test2.txt $ cat test2.txt This is a test EOL Line 2 EOL Line 3 EOL The echo command appended EOL to each line as it passed through rather than just doing it once at the end of the file content.
@fernabianer18985 жыл бұрын
Richard Payne thats my new favorite comment
@samiordning97086 жыл бұрын
Once again, thanks for a great video. Got some good tips how to do things in terminal. Keep up the good work and be well.
@BrucesWorldofStuff6 жыл бұрын
Great video Joe! Never get tired of these, I always get something new and I use them as references when I want to do something... Thanks Joe!
@kiwifren42546 жыл бұрын
Just watching your Bash basics (part 3) AMAZING!!!!
@finndriver10636 жыл бұрын
Nice video! pushd and popd are my new best friends. My personal favourite commands are: - jobs, fg, bg, disown - pgrep, pkill, ps - lsblk - script, scriptreplay - hunt, bcd, ppt, ul
@matthewhodge1965 жыл бұрын
Really enjoy your videos. I appreciate your open-source mindset and your willingness to help others indulge into the wonderful world which is open-source. Wondering if you could explain to us in another video the differences between the various DE terminal variations. (MATE terminal vs. xfce terminal vs.Cinnamon terminal, etc.) I am still a fairly green in the linux world, so perhaps a video dedicated to this subject isn't necessary. Personally, I enjoy your explanations of specific situations in which a specific command would be useful. Great channel Joe! Always looking forward to new videos.
@rudyseghers63206 жыл бұрын
Tanks Joe, from the Netherlands.
@macinman5 жыл бұрын
Some of these commands I was already familiar wit. The more programming oriented commands I found interesting. I was curious, if there are any BASIC packages for Linux, that's the main language I've had experience with. I have done some C, and I've used bash, though I'm experimenting with FISH right now. I'm going to be installing FreeBSD into a VM sometime in the future and going to do some testing and comparison between it and Linux to see which I like better, and what differences are, etc. Great video Joe, always enjoy watching :)
@kellingc5 жыл бұрын
^S and ^Q is a hold over from the modem days. It's proc code is XOFF (^S) which tells the host to stop sending. XON (^Q) tells the host to rezume sending. With a full duplex modem connection, you type a character, the terminal sends it to the host, and the host sends a copy of the character back to confirm by displaying it on the screen or printing on the paper. Control characters didn't print, because they are commands to the host. ^G rang the terminal bell, ^L caused a vertical tab (or form feed), ^M cauused a carriage rrturn, and ^N casued a new line. There are others, but you get the idea. The point is the reason nothing typed when you pressed ^S, the host hsld sending the character to the screen until it was told to send ^Q. It then sent what was in the buffer to the screen. With the more and less commands, ^S and ^Q is really useless unless you accidently come across a binary file and use cat. You could use ^S to stop it and ^Q to resume where it left off.
@petewest31226 жыл бұрын
Really informative. Thanks for all the top tips, Joe
@jackd61345 жыл бұрын
Very *useful* video and clear presentation!
@michelecarey96684 жыл бұрын
Love your videos. Glad I subscribed.
@alexherget6 жыл бұрын
Awesome vid! Thank you very much Joe for sharing this great info. Big thumbs up !!
@VictoriaMan69 Жыл бұрын
Thanks for teaching me about wget!
@jlmg35433 жыл бұрын
Greetings and salutations! Thank you for the amazing video :-) edit: typo
@Khyree_Holmes6 жыл бұрын
Linux shutdown commands are my favorite!
@FinderX6 жыл бұрын
46:35 here, you can improve your script adding this option to DF -x devtmpfs From the MAN ; ) *-x, --exclude-type=TYPE* limit listing to file systems not of type TYPE This gonna rid those udev from the output.
@MacsekU2B Жыл бұрын
usually when I want to run a long time running program I start it in screen, then detach. In case I need status I oftentimes run watch to see du, df, ls, iotop, ps or whatever, mostly on another screen (ctrl-a c) If not using screen then &. That way no cat is intelligent enough to interfere with the long-running program
@igorthelight6 жыл бұрын
Also, cat is not unpredictable: * If you type and hit Enter - you actually added that to the file. You can even kill a Terminal Emulator. It's ALREADY commited. * Until you hit Enter it's not written. So Ctrl + D = Ctrl + C in this case. Also, if wget downloads slower than your normal download speed, that means that server doesn't "want" to give you a better speed. For that you need "axel" or "aria2". They use more that one connection to speed up downloading. Of course you have to install one of them first... if you HAVE TO use wget - you just can make it download in parallel mode: wget -r -np -N [url] & wget -r -np -N [url] & wget -r -np -N [url] & wget -r -np -N [url] Now you will donwload using 4 connections. But that trick will NOT help if you downloading just one file (as far as I know).
@EzeeLinux6 жыл бұрын
It's unpredictable when compared to something like nano...
@igorthelight6 жыл бұрын
@@EzeeLinux I agree.
@MichaelMantion6 жыл бұрын
1:30 If I knew what I was doing it wouldn't be called learning. In general I always try to learn when ever possible, so I rarely what I am doing before I do it.
@hielke23326 жыл бұрын
I think your Percy's patch can be improved to make it catch all the input and not only till the first line break. You can do this by setting the delimiter to an empty string. It also seems that the max characters can be left out. Like so: read -d '' -t 1
@EzeeLinux6 жыл бұрын
For some reason, it does not do this when running in a script. At least it didn't when I tested it last. Thanks for the input, though. :)
@hielke23326 жыл бұрын
@@EzeeLinux That is odd. Not when I tested it. Another idea would be to use cat to catch the input. Like so: 𝚜𝚕𝚎𝚎𝚙 𝟽; 𝚌𝚊𝚝 > /𝚍𝚎𝚟/𝚗𝚞𝚕𝚕. But it won't automatically terminate when done. You have to provide Ctrl+D to stop it. Twice even for some reason. You also don't get any feedback when it is done. To get at least a hint that your script is done you can use for example Perl to print something when done. 𝚜𝚕𝚎𝚎𝚙 𝟽; 𝚙𝚎𝚛𝚕 '𝚠𝚑𝚒𝚕𝚎(){𝚙𝚛𝚒𝚗𝚝 "𝚍𝚘𝚗𝚎";}' But I wouldn't say this has now become a very elegant solution, but I guess a patch is often not very elegant.
@MyszkaAgresorka6 жыл бұрын
@@hielke2332 𝚌𝚊𝚝 > /𝚍𝚎𝚟/𝚗𝚞𝚕𝚕
@petewest31226 жыл бұрын
Off topic to the video - After running update manager in LM 19, I get an error list of a bunch of packages and files that have been configured in multiple destinations. 1. Is this anything to be concerned about. 2. Is there a simple solution to resolving all of the redundant packages? I'm aware that certain files - such as bashrc - are stored as backups and should therefore be left alone. Is there an easy way to cross-reference which files have purposeful backups, and which are truly redundant?
@EzeeLinux6 жыл бұрын
I'm not sure what you talking about here... Run sudo apt update and then see what it says. Apt will usually suggest a command to fix/clear the issue.
@petewest31226 жыл бұрын
@@EzeeLinux Thanks for replying. I had a closer look, and somehow I ended up with a duplicate repository list in /etc/apt/. I deleted the one created most recently, re-ran update manager, and no more errors. Edit* I saved a copy before deleting, just in case.
@KDGNOR6 жыл бұрын
"cd -" switch back to last place you are at.
@EzeeLinux6 жыл бұрын
Still not the same thing: unix.stackexchange.com/questions/272965/pushd-popd-vs-cd-cd-in-bash-and-zsh
@chrikrah5 жыл бұрын
Will dpkg -l work on all Linux distros?
@EzeeLinux5 жыл бұрын
No, It only works on Debian based distros. Debian, Ubuntu Linux Mint and so on... :)
@tomormiston65926 жыл бұрын
Also when buying a 'new' old machine, in the live install say $ inxi -F $ lsusb $ free -h $ speedtest-cli Maybe I'd cat foocomand >> system.txt them to a file too... 🤔
@marko11kram5 жыл бұрын
i find that just using vi is simpler than using cat to edit a file
@Ilsh19646 жыл бұрын
". .profile" or ". .bashrc" is not equivalent to "source .profile" or "source .bashrc"?
@EzeeLinux6 жыл бұрын
Yes, it is... I just didn't do it that way. :)
@drhectoralmonte5 жыл бұрын
Great
@amrodiab31434 жыл бұрын
"The root account does not exist in Ubuntu"......errrrrr, what? Factually incorrect Also, it's not asking for your password, it's asking for root's password. That whole section has several fallacies.
@EzeeLinux4 жыл бұрын
The root account is locked and therefore for all intents and purposes does not exist... Those with sudo privileges act as root but are not logged in as root. Any cleaerer for you?
@amrodiab31434 жыл бұрын
Agreed that it is locked, but you mentioned specifically at least twice that it doesn't exist - that is very different to it being locked. There are many other accounts created by detfault which are also locked in various ways - but by saying it doesn't exist so forcefully can lead to it being taken literally by some especially when targetting a beginner audience who have just been introduced to that user.
@EzeeLinux4 жыл бұрын
@@amrodiab3143 I've been doing this a long time... I sad the account is locked and then said in effect it does not exist. You have to be forceful and generalize to get the point across. Anybody who would dig in a bit deeper would eventually understand what you're talking about. That's all that matters...
@igorthelight6 жыл бұрын
> That's a "greater than" < That's a "less than" How to memorise them? > Points to the right - that's "greater" < Points to the left - that's "less" BUT the main question is: Is "cat" a real cat? :-) By the way - can you review a SteamOS? I know - there are some reviews on the KZbin but they are kinda old. Maybe Valve did something cool with it? :-)
@EzeeLinux6 жыл бұрын
Thanks for trying... It never takes, even after nearly 50 years.
@igorthelight6 жыл бұрын
@@EzeeLinux :-)
@free-john_20086 жыл бұрын
@@EzeeLinux As a former 1st grade teacher, think of it as a mouth. It always opens to eat the bigger one.
@EzeeLinux6 жыл бұрын
@@free-john_2008 LOL.. Yep. I still forget. Thanks, Mr. President! :)
@richardpayne5 жыл бұрын
@@EzeeLinux Big end is greater than small end. Ie 5 > 4 and 4 < 5 are both 5 greater than 4, or conversely 4 less than 5. Big end points at the thing that should be greater than.
@jeanrodrigues6249 Жыл бұрын
Livro
@henrymach6 жыл бұрын
curl is better than wget
@EzeeLinux6 жыл бұрын
nano is better than vi. :)
@henrymach6 жыл бұрын
It is indeed. But I got the joke
@hanes26 жыл бұрын
dud, you wanna join the ZSH creww :P
@EzeeLinux6 жыл бұрын
No, I'm good with BASH. I use it and teach it because it's what everybody gets to start with. :)