JC's Favorite BASH Commands

  Рет қаралды 26,155

Joe Collins (EzeeLinux)

Joe Collins (EzeeLinux)

Күн бұрын

Пікірлер: 61
@richardpayne
@richardpayne 5 жыл бұрын
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.
@fernabianer1898
@fernabianer1898 5 жыл бұрын
Richard Payne thats my new favorite comment
@samiordning9708
@samiordning9708 6 жыл бұрын
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.
@BrucesWorldofStuff
@BrucesWorldofStuff 6 жыл бұрын
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!
@kiwifren4254
@kiwifren4254 6 жыл бұрын
Just watching your Bash basics (part 3) AMAZING!!!!
@finndriver1063
@finndriver1063 6 жыл бұрын
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
@matthewhodge196
@matthewhodge196 5 жыл бұрын
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.
@rudyseghers6320
@rudyseghers6320 6 жыл бұрын
Tanks Joe, from the Netherlands.
@macinman
@macinman 5 жыл бұрын
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 :)
@kellingc
@kellingc 5 жыл бұрын
^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.
@petewest3122
@petewest3122 6 жыл бұрын
Really informative. Thanks for all the top tips, Joe
@jackd6134
@jackd6134 5 жыл бұрын
Very *useful* video and clear presentation!
@michelecarey9668
@michelecarey9668 4 жыл бұрын
Love your videos. Glad I subscribed.
@alexherget
@alexherget 6 жыл бұрын
Awesome vid! Thank you very much Joe for sharing this great info. Big thumbs up !!
@VictoriaMan69
@VictoriaMan69 Жыл бұрын
Thanks for teaching me about wget!
@jlmg3543
@jlmg3543 3 жыл бұрын
Greetings and salutations! Thank you for the amazing video :-) edit: typo
@Khyree_Holmes
@Khyree_Holmes 6 жыл бұрын
Linux shutdown commands are my favorite!
@FinderX
@FinderX 6 жыл бұрын
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
@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
@igorthelight
@igorthelight 6 жыл бұрын
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).
@EzeeLinux
@EzeeLinux 6 жыл бұрын
It's unpredictable when compared to something like nano...
@igorthelight
@igorthelight 6 жыл бұрын
@@EzeeLinux I agree.
@MichaelMantion
@MichaelMantion 6 жыл бұрын
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.
@hielke2332
@hielke2332 6 жыл бұрын
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
@EzeeLinux
@EzeeLinux 6 жыл бұрын
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. :)
@hielke2332
@hielke2332 6 жыл бұрын
@@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.
@MyszkaAgresorka
@MyszkaAgresorka 6 жыл бұрын
@@hielke2332 𝚌𝚊𝚝 > /𝚍𝚎𝚟/𝚗𝚞𝚕𝚕
@petewest3122
@petewest3122 6 жыл бұрын
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?
@EzeeLinux
@EzeeLinux 6 жыл бұрын
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.
@petewest3122
@petewest3122 6 жыл бұрын
@@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.
@KDGNOR
@KDGNOR 6 жыл бұрын
"cd -" switch back to last place you are at.
@EzeeLinux
@EzeeLinux 6 жыл бұрын
Still not the same thing: unix.stackexchange.com/questions/272965/pushd-popd-vs-cd-cd-in-bash-and-zsh
@chrikrah
@chrikrah 5 жыл бұрын
Will dpkg -l work on all Linux distros?
@EzeeLinux
@EzeeLinux 5 жыл бұрын
No, It only works on Debian based distros. Debian, Ubuntu Linux Mint and so on... :)
@tomormiston6592
@tomormiston6592 6 жыл бұрын
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... 🤔
@marko11kram
@marko11kram 5 жыл бұрын
i find that just using vi is simpler than using cat to edit a file
@Ilsh1964
@Ilsh1964 6 жыл бұрын
". .profile" or ". .bashrc" is not equivalent to "source .profile" or "source .bashrc"?
@EzeeLinux
@EzeeLinux 6 жыл бұрын
Yes, it is... I just didn't do it that way. :)
@drhectoralmonte
@drhectoralmonte 5 жыл бұрын
Great
@amrodiab3143
@amrodiab3143 4 жыл бұрын
"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.
@EzeeLinux
@EzeeLinux 4 жыл бұрын
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?
@amrodiab3143
@amrodiab3143 4 жыл бұрын
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.
@EzeeLinux
@EzeeLinux 4 жыл бұрын
@@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...
@igorthelight
@igorthelight 6 жыл бұрын
> 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? :-)
@EzeeLinux
@EzeeLinux 6 жыл бұрын
Thanks for trying... It never takes, even after nearly 50 years.
@igorthelight
@igorthelight 6 жыл бұрын
@@EzeeLinux :-)
@free-john_2008
@free-john_2008 6 жыл бұрын
@@EzeeLinux As a former 1st grade teacher, think of it as a mouth. It always opens to eat the bigger one.
@EzeeLinux
@EzeeLinux 6 жыл бұрын
@@free-john_2008 LOL.. Yep. I still forget. Thanks, Mr. President! :)
@richardpayne
@richardpayne 5 жыл бұрын
@@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
@jeanrodrigues6249 Жыл бұрын
Livro
@henrymach
@henrymach 6 жыл бұрын
curl is better than wget
@EzeeLinux
@EzeeLinux 6 жыл бұрын
nano is better than vi. :)
@henrymach
@henrymach 6 жыл бұрын
It is indeed. But I got the joke
@hanes2
@hanes2 6 жыл бұрын
dud, you wanna join the ZSH creww :P
@EzeeLinux
@EzeeLinux 6 жыл бұрын
No, I'm good with BASH. I use it and teach it because it's what everybody gets to start with. :)
@igorthelight
@igorthelight 6 жыл бұрын
Be gone occultist! ;-)
Linux BASH Shell Script Basics Part 3
51:20
Joe Collins (EzeeLinux)
Рет қаралды 18 М.
Become a bash scripting pro - full course
36:00
CODE IS EVERYTHING
Рет қаралды 62 М.
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 128 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 11 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,5 МЛН
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,2 МЛН
BASH Environment | Aliases, Functions and Scripts
49:26
Joe Collins (EzeeLinux)
Рет қаралды 90 М.
Introduction to Advanced Bash Usage - James Pannacciulli @ OSCON 2014
42:53
James Pannacciulli
Рет қаралды 132 М.
Linux Terminal Basics 2 | Working with Files
43:34
Joe Collins (EzeeLinux)
Рет қаралды 15 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 71 М.
Creator of git, Linus Torvalds Presents the Fundamentals of git
1:10:15
Developers Alliance
Рет қаралды 118 М.
Linux Terminal Basics 1 | Working with Text
35:24
Joe Collins (EzeeLinux)
Рет қаралды 34 М.
A Beginner's Introduction to BASH Shell Scripting
44:24
Joe Collins (EzeeLinux)
Рет қаралды 290 М.
My 5 Favorite Linux Shell Tricks for SPEEEEEED (and efficiency)
11:06
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26