Just so. Even though when reading it in my head, it doesn't make a sound! 🙂
@12Q46HPRN
Жыл бұрын
Congrats on 300,000! Another great video as always. Thank you so very much!
@zionpsyfer
Жыл бұрын
20+ years... how did I not know this? You sir, are always an awesome source of info. Thank you and congrats on 300k!
@maneeshpatel1594
Жыл бұрын
One nice use of "tr" is to delete all characters (with the -d flag) that lie outside a certain range (with the -c flag). Thus, the command tr -cd '\11\12\15\40-\176' < bad_file.txt > good_file.txt will remove all non-ASCII characters from a bad file and save the result to a good file. (One should be aware, though, that this command will also get rid of characters like è.)
@alain-pierrep.312
Жыл бұрын
Great video ! Here are my 2 cents worth of comments. Firstly, to the question "How tr differs from sed ?", I usually answer that tr works one character at a time and is (but it should be experimentally confirmed) probably more efficient than sed on certain simple transformations. Secondly, I always enclose tr arguments in single quotes to avoid shell expansion. Generally speaking, it's a good habit to "protect" with single quotes or backslashes what should be left untouched by the current shell. Let's assume that, in the current directory, we have only one file, named "b". The "tr [a-z] [A-Z]" command will be transformed in "tr b [A-Z]" by the shell before tr is executed. The result won't be what was expected.
@SwiatLinuksa
Жыл бұрын
Thanks Jay got everything you doing. Your videos was inspiration for me to start using Linux 4 years ago, and 6 months later i started Linux channel in Poland. Thank you very much again. Edit: Congratulations 300k subs. Btw.
@jonathanrider4417
Жыл бұрын
Congrats on 300,000! Keep up your fantastic work!
@sodakk17
Жыл бұрын
congrats for the achievment. Hope to see your channel growing even more.
@Mantecoso87
Жыл бұрын
Congratulations, glad to see the channel growing!
@pctlc
Жыл бұрын
Wow Congratulations on 300k awesome!!
@ChrisPinCornwall
Жыл бұрын
Well! I never knew that! I've been using Unix/Linux since the mid eighties, and I've never come across it. Thank you.
@dreamcat4
Жыл бұрын
fabulous community educational work you are doing here. to try to make interesting these historical unix commands. and very worthwhile. it brings back some memories of how i learned text manipulation in posix shell myself.... thing is that sny 1 single command is helpful to identify. but to make practical powerful usage requires stringing together with maybe n of m 'common vocabulary command set'.... the way i learned myself was to use sed as the main focus and starting point. and then to 'bring back' or reintroduce other commands (indeed like tr or cut). to make as a complement. my feeling is that this approach works because i use sed 's///g' so much frequently, almost in everything i can. that it's occurence in practical 'do some text manipulation operations on a random thing' works so often. of course in combination with other ubiquitous posix compliant syntax, cmds and builtings. for example the $() command substitution. and whatever else.... still it is a 'tough road' for the newcomer, and the real learner for me was with a process of trial and error, testing isolated statements until they executed correctly and gave the valid and intended desired output.... to then have a demonstrated confidence to move on to chaining multiple such commands together. as inputs and outputs to the next shell fraqment etc. whether it be a variable assignment, or a pipe, or a conditional evaluation. i hope my input is well received. because people probably feel dumb to make so many simple errors for so long. but if you can demonstrate a real life workflow.... warts and all. including some genuine mistakes. then i think that would be great! along also with side discussions about 'general areas of proficiency'.... which for example one of those would be to master string quoting and string escaping. then also with some sort of 'timelines' or general expectations of how many weeks months or years it takes to really become proficient and second nature. i myself took several years. with a handful of larger projects. plus many smaller individual personal scripts. perhaps an example of a simple script, that an individual user might find they need? well one script i wrote was to control volume on my pc, for specific hardware device, to wire up to global hotkeys. to set levels on alsa instead of pulse audio. another example was to auto upgrade apt sources. and probe / test them after ubuntu os upgrades. and many other such personal scripts, that we do to simply make our lives easier and more comfortable. to fill in the gaps where there is no out of the box solution. but we want the computer work in specific ways and have a good feeling that the specific goal is an achievable outcome. and many other scripts, a simply countdown timer that uses 'termdown', but then after that launches 'xcowsay' + plays an audible alert sound that repeats several times. whereby the input arg1 to the 'timer' script is a text sting in the format '40s' or '3h24m'... things like this. and believe it or not.... there was no pre-existing solution to that one! i really did have to write my own custom script for it. i am sure you also can think of many of your own general purpose or 'special purpose' examples too. but what is more important is to give users the feeling they can pro activelt, and creatively invent their own scripts, whenever they are unhappy or spot a glaring effeciency gap in their everyday workflows...although i suppose a lot of users resort to python these days. instead of writing traditional posix compliant scripts, and sticking to that as the iso standards modernized version of the original k&r bourne shell. ah well! ....to let them deal for the python bugs instead. and maybe some slower process launch times. different sets of pros/cons all of it
@chancepaayokigarchha3663
Жыл бұрын
Jay my brother, can you make a series on AWK and SED ? Besides, I think your channel lacks the content regarding Disk Management..Can you prepare a solid series on Disk Management? It would be a hit for sure.
@RoughGanome
Жыл бұрын
Useful command. I use this command to translate commas into spaces in a file. Then I can use awk to parse the separate fields. The problem is, there are spaces before and after the commas sometimes and other times no spaces at all. Using TR, fixes all of the comma issues 'tr , " " '
@TheLakeJake3
Жыл бұрын
Studio always looking nicer jay!
@sussusamogus7831
Жыл бұрын
Thanks for the guide Jay :)
@samoylov1973
Жыл бұрын
Congratulations on 309 000 subscribers! For those in zsh these 'tr' commands will be: % your_phrase="Your phrase" % echo ${your_phrase:l} % echo ${your_phrase:u} respectively
@lstyle3210
Жыл бұрын
Great presentation!
@ruixue6955
Жыл бұрын
2:07 start 6:22 for delete
@heckyes
Жыл бұрын
Oh damn, the new remixed version of the intro music is gg. Wow, new HD camera and studio lighting as well?
@krishnachaithanyaks9693
Жыл бұрын
Hi Mr. Jay, Can you please make a Crash Course on LDAP authentication and Authorisation in Linux?
@peterjansen4826
Жыл бұрын
I use that command to get the RAM-usage and battery-usage in my 'panel' (xsetroot).
@kamurashev
Жыл бұрын
Nice 👍
@samplesandtests
Жыл бұрын
what if you want to remove a non ASCII character like: Null, Line feed, EOF, etc?
@maneeshpatel1594
Жыл бұрын
That is one of the things I use it for. As a toy example: echo "Today: " | tr ' ' ' ' ; date
@ubeaut
Жыл бұрын
Does tr command work with other languages? How would [a-z] work? I guess [:lower:]?
@xtsdagger6956
Жыл бұрын
Not sure about the title, isn't crashing considered bad in an OS?
@mathieuleclerc4136
Жыл бұрын
is it possible to create a new text file where the tr changes have been made?
@davidmutua6971
Жыл бұрын
Yes by piping it into tee command
@Eric3Frog
Жыл бұрын
It’s basically a “find and replace” command.
@javabeanz8549
Жыл бұрын
on steroids...
@javabeanz8549
Жыл бұрын
So they finally are changing advertising away from Linode.
@asv5769
Жыл бұрын
Not really :) Akamai acquired Linode.
@javabeanz8549
Жыл бұрын
@@asv5769 They did that some time ago, but in March it was still advertised as Linode
@QuimChaos
Жыл бұрын
sadly if you are using zsh this will not work 8/
@OhItsAnthony
Жыл бұрын
You need to replace the square brackets with single quotation marks eg echo "Hello World" | tr [a-z] [A-Z] becomes echo "Hello World" | tr 'a-z' 'A-Z' If you want to use the :lower: and/or :upper: syntax then you'll need to just add single quotes around the square brackets, eg '[:lower:]' EDIT: edited for clarity
@QuimChaos
Жыл бұрын
@@OhItsAnthony thanks!!! I was trying everything without square brackets and it worked for the ranges a-z && A-Z but not :lower: and similar... this works echo "Hello World" | tr a-z A-Z echo "Hello World" | tr '[a-z]' '[A-Z]' echo "hello World" | tr '[:lower:]' '[:upper:]' echo "hello World" | tr "[:lower:]" "[:upper:]" i guess just using quotes around the square brackets works
@rockymarquiss8327
Жыл бұрын
Good thing you didn't have matthew@localhostt with the -s example... LOL
@javabeanz8549
Жыл бұрын
I was expecting to see "hostt" "host"
@Laflamablanca969
Жыл бұрын
Rip linode. Time to move to digital ocean
@javabeanz8549
Жыл бұрын
DO has it's own issues. 1) don't try sending outbound email from DO, it's blocked by big providers, like GMail 2) their support is not what I would call good, the last few issues I have had, they don't seem to bother actually reading the request, they cherry pick a few words and toss back a reply. 3) their prices went up recently, but I think Linode, now Akamai, did that as well.
@SlideRSB
Жыл бұрын
Very surprising that Akamai decided to kill the Linode brand.
@javabeanz8549
Жыл бұрын
@@SlideRSB I think that they should have marketed it as "Linode by Akamai"
@SlideRSB
Жыл бұрын
@@javabeanz8549 That's what I thought they were going to do.
@Laflamablanca969
Жыл бұрын
It just shows that the brand Akamai is more important than the customer base of linode. Yeh, I’m out.
Пікірлер: 46