Today's article is me trying something a little different...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,809
Reaction score
10,376
Credits
97,674
I've been writing long articles. So, I thought to myself, "Self, I think I'll try something new." I decided to pull out a short/easy topic from my notes and to write an article that is shorter in length than most of my articles. Brevity is not my strong suit.


It's the easiest article on my site, outside of the articles that have no tasks associated with them - and even those take longer to read.
 


So, we’ll be doing this in the terminal. That’s a nice place to do things. Press CTRL + ALT + T and your default terminal should open. If it doesn’t open, pick a better distro!

As much as my opinion is worth, I'd say that I approve this bit of assertiveness from you. It bashes these anarchist programmers with a bit of microaggression, who are changing well established keyboard shortcuts for entirely insipid reasons. Then again, it is also aimed at my distro of choice (PoP!_os), since it uses the combination of Win+T for the terminal, but no matter, I still support it. It a refreshing amount of "message reinforcement" in an excessively polite society.

That being said, I don't think anyone with a desktop environment is going to have difficulties in locating their home folder; and if they do, then the use of a terminal would a comparatively impossible task for them. Its really just one click away for most desktops!
Screenshot from 2023-08-29 20-32-03.png
 
I can usually find my home directory, but I still can't find Waldo.
 
It bashes these anarchist programmers with a bit of microaggression, who are changing well established keyboard shortcuts for entirely insipid reasons.

In pretty much every case, there's no reason to not support both out of the box. Even if you're using the super+<key> method, it's not that hard to keep the defacto standard as well.

Fortunately, you can usually add the shortcut pretty easily.

And, it's definitely easy to find home. It may not be so easy on a server with a wonky configuration, but you should be able to find it nice and easily.

I figured a nice easy article would be a fun change of pace.

I actually meant to include echo $OLDPWD in there somewhere, but I didn't. I think I'm going to end up modifying an old article to include it and call it a day. I just need a day when I'm thinking of it, a day when I am not interested in writing a different article, and a day when I want an easy day.

It'll happen!

I can usually find my home directory, but I still can't find Waldo.

I'm partially colorblind (with problems between the colors, like some shades of blue will look black) due to not having enough cones or something like that. I'm not fully colorblind or anything and didn't learn about it until I was older - so I probably wasn't when I was younger.

See, people kept arguing with me about colors. It came to a head when I was certain the kitchen curtains were orange and white.

I had enough arguments to make me think I was wrong. So, I went and got tested. It turns out, I was wrong. Now I no longer argue about colors.

Anyhow, I can't find Waldo all that easily. I kind of want to make a book titled as F*** Waldo, where he's not in any one of the fricken' pictures. No matter how long you look, you will not find Waldo. Now they'll know how I feel.

I also can't do those stupid things where you stare at some blurry lines and out pops a lighthouse or a sailboat. Those things just make me mad. I've never seen a single thing in any of those pictures.
 
And, it's definitely easy to find home. It may not be so easy on a server with a wonky configuration, but you should be able to find it nice and easily.

From the command line, usually cd ~ ( tilde )
will get you there.
 
From the command line, usually cd ~ ( tilde )
will get you there.

Yup. That's in the article, though you echo it in the article. echo ~
 
Too much typing!

For a 33% reduction, just cd and <Enter>. Presto! ;)

(That's Linux Mint. YMMV.)
That's good for "going home" in the filesystem, but it doesn't tell you what home is, rather, it just takes you there. Once there, the user can find out where they are with the command: pwd.

Code:
[flip@flop ~/dir1]$ cd
[flip@flop ~]$ pwd
/home/flip
[flip@flop ~]$ echo ~
/home/flip

[flip@flop ~] cd dir1
[flip@flop ~/dir1] echo ~
/home/flip
 
@osprey : The naked "cd" works in Tiny Core, too (using busybox ash), so I suppose that's common usage.

To find out what a user's home directory is, you could always grep for the username in /etc/passwd
Code:
grep root /etc/passwd |cut -d: -f6
/root
@dos2unix : Waldo was last seen in ~Waldo
 
@osprey : The naked "cd" works in Tiny Core, too (using busybox ash), so I suppose that's common usage.

To find out what a user's home directory is, you could always grep for the username in /etc/passwd
Code:
grep root /etc/passwd |cut -d: -f6
/root
@dos2unix : Waldo was last seen in ~Waldo
Yes, cd is a bash builtin that will always take the user home in bash and it's family of shells. Can't speak for all shells though.

I guess one aspect which users may appreciate of "echo ~" is that it'll tell the user what home is from anywhere in the filesystem without having to go there.
 
Except for root, are there any deviations from /home/username in any distro?

If you can't remember your own name, maybe you shouldn't be using a computer? ;)
 
In Mint Cinnamon I always put Home icon on the Desktop.
2023-08-30-12-06.png
 
If you can't remember your own name, maybe you shouldn't be using a computer? ;)

Two key things to remember (outside of us desktop Linux users - which is just a tiny percentage of users) is that you don't always have a GUI and you're not always working on a system you configured - and so you have no idea how wonky the configuration might be.

We're all desktop Linux users. Though there are millions of us, far more systems don't even have a desktop installed. As desktop users, we tend to forget that. I do not.
 
Gentlemen, I believe you are blowing this out of proportion. The purpose of this topic is to keep it simple for beginners, like the article KGIII has posted, and here we are seeing ever more complex lines of code posted by each successive user here.

These things are easily comprehensible, but for us! Put yourself in the position of someone who doesn't know these things - a drooler, does barely know how to hold a mouse in his hand, has to stare at a keyboard and look for buttons to type, and here you are, showering that person with lines of code where that won't work if that person so much as types a single letter wrong!
 

Members online


Top