This newbie has overcome his fear of the terminal

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
carum carvi

This newbie has overcome his fear of the terminal

Post by carum carvi »

The Linux Command Line
Fourth Internet Edition
William Shotts

I saw a link in another newbies post who wanted to have a manual for learning command lines. I clicked it and now I am hooked. Learned more about how Linux works in an hour than in the past few months. Amazing.

I finally have overcome my fear of the terminal. Since I got myself entangled into a busybox several times with LM19 I understood the need to know some basic commands.

My first lesson with the Linux Command Line PDF was a warning NOT to use spaces in filenames. That is a habit I had copied from Windows. I now understand why it is better not to use spaces. It may seem like a little thing, but knowledge of many little things like these, surely make managing LinuxMInt even more easier.

Well, I just wanted to express my joy at learning to know the terminal better. A newbie victory over my fear of the terminal, lol...
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12334
Joined: Sun Aug 09, 2015 10:00 am

Re: This newbie has overcome his fear of the terminal

Post by deepakdeshp »

Welcome to the terminal land
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: This newbie has overcome his fear of the terminal

Post by xenopeek »

Sourceforge won't proceed with download so can't check what exactly the book said, but flat out saying you shouldn't use whitespace in filenames is weird. It's fine.

On the terminal you just have to remember to:
  • Quote filenames with whitespace in them, as in cat "my file.txt"
  • Or escape whitespace (prefix it with a backslash), as in cat my\ file.txt
  • Or use file globbing (which could match multiple files), as in cat my*.txt
Pressing Tab key on the terminal after typing a partial filename will auto-complete the name and add escapes for whitespaces where needed. I'd guess most use that.
Image
HaveaMint
Level 6
Level 6
Posts: 1085
Joined: Fri Feb 02, 2018 9:56 pm

Re: This newbie has overcome his fear of the terminal

Post by HaveaMint »

xenopeek wrote: Thu Nov 01, 2018 9:35 am Sourceforge won't proceed with download so can't check what exactly the book said, but flat out saying you shouldn't use whitespace in filenames is weird. It's fine.

On the terminal you just have to remember to:
  • Quote filenames with whitespace in them, as in cat "my file.txt"
  • Or escape whitespace (prefix it with a backslash), as in cat my\ file.txt
  • Or use file globbing (which could match multiple files), as in cat my*.txt
Pressing Tab key on the terminal after typing a partial filename will auto-complete the name and add escapes for whitespaces where needed. I'd guess most use that.
Even though I do know what you mean, I am waiting for the "I don't see any white spaces" :D
Selection_002.jpg
"Tune for maximum Smoke and then read the Instructions".
gm10

Re: This newbie has overcome his fear of the terminal

Post by gm10 »

HaveaMint wrote: Thu Nov 01, 2018 9:47 am "I don't see any white spaces" :D
Exactly. Stop the racial discrimination of spaces. Black spaces matter! :lol: :lol: :P

But seriously, not seeing a problem with spaces in file names, either. If anything they are the easiest special characters to deal with. Quotation marks, wild card characters and things like that as part of the actual file name can be much more annoying.

Code: Select all

$ touch "'Quote*\'this'"
$ ls
''\''Quote*\'\''this'\'''
Beautiful. :D
Last edited by gm10 on Thu Nov 01, 2018 9:57 am, edited 1 time in total.
aes2011
Level 4
Level 4
Posts: 498
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 »

xenopeek wrote: Thu Nov 01, 2018 9:35 am Sourceforge won't proceed with download
https://sourceforge.net/projects/linuxc ... stdownload worked for me. I used Google Chrome incognito mode with absolutely no ad/script blocker.
aes2011
Level 4
Level 4
Posts: 498
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 »

While it's true that files with spaces in their names can be dealt with, I prefer to avoid spaces in files I create.

I like this oldish link on filenames: http://pclosmag.com/html/Issues/201607/page03.html
Faust

Re: This newbie has overcome his fear of the terminal

Post by Faust »

carum carvi wrote: Thu Nov 01, 2018 6:41 am ......
I finally have overcome my fear of the terminal.
.....
My first lesson with the Linux Command Line PDF was a warning NOT to use spaces in filenames. That is a habit I had copied from Windows. I now understand why it is better not to use spaces. It may seem like a little thing, but knowledge of many little things like these, surely make managing LinuxMInt even more easier.
Congratulations !
Your life will be improved for evermore .....
...... OK , slight exaggeration :lol:

As to white-space in filenames ..... Don't do it ! .... just say no .
Keep yourself and your coding on the path of true purity ..... 8)

Why bother with having to escape characters in filenames ? .... it is twisted thinking and it makes no sense at all to me .

But I'm getting old , and I came to Linux with my old UNIX head on ..... call me old-fashioned if you will .... :mrgreen:
User avatar
absque fenestris
Level 12
Level 12
Posts: 4110
Joined: Sat Nov 12, 2016 8:42 pm
Location: Confoederatio Helvetica

Re: This newbie has overcome his fear of the terminal

Post by absque fenestris »

I've been working with spaces in title names for 24 years (Mac first and Linux 15 years later).
That was my protest against DOS and Windows.
It's easier to read - for human beings and looks more beautiful.
Quite a lot of devices have broken down over time, but my backed up old and new data - with spaces in the titles - I can still read and edit...
User avatar
majpooper
Level 8
Level 8
Posts: 2084
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: This newbie has overcome his fear of the terminal

Post by majpooper »

aes2011 wrote: Thu Nov 01, 2018 10:01 am While it's true that files with spaces in their names can be dealt with, I prefer to avoid spaces in files I create.

I like this oldish link on filenames: http://pclosmag.com/html/Issues/201607/page03.html
I avoid spaces as well - just individual preference. Years ago in college I was taught myFile.txt approach which is now habit and works well for me but as xenopeek points out there are more than one to skin this cat (no pun intended).
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: This newbie has overcome his fear of the terminal

Post by Flemur »

carum carvi wrote: Thu Nov 01, 2018 6:41 amMy first lesson with the Linux Command Line PDF was a warning NOT to use spaces in filenames.
Excellent advice. You can get around it as others described, but spaces will probably cause you trouble eventually (like when you don't expect files with spaces in the names), and there's not much of an upside. Almost no OS files contain spaces (just wallpaper names on my system)
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: This newbie has overcome his fear of the terminal

Post by xenopeek »

Legibility or how do you folks keep your business and home administration in order.
2018-11-02_with_files_named_like_this.ods or 20181102WithFilesNamedLikeThis.ods?
I prefer "2018-11-02 With Files Named Like This.ods" as easier :)

Same with directory names; "My New Project" not my_new_project or MyNewProject.

I use names-like-this for scripts but certainly not stabbing my eyes with underscores, dashes or camelcase for everything else. If you're writing scripts where you deliberately go out of your way to not handle spaces in filenames, well sure. I can't think of an example where spaces are a problem.
Image
carum carvi

Re: This newbie has overcome his fear of the terminal

Post by carum carvi »

"Though Linux supports long filenames which may contain embedded spaces and punctuation characters, limit the punctuation characters in the names offiles you create to period, dash, and underscore. Most importantly, do not embed spaces in filenames. If you want to represent spaces between words in a filename, use underscore characters. You will thank yourself later."

Quote from the LinuxCommandLIneManual pdf

I thought it would make it better understandable where my advice came from by quoting it.

One of two reasons why I did not started to use LinuxMint earlier was because of compatibility issues of files between Microsoft and Linux. Eager to not make the same mistake twice I was searching for the best way to name files in order to exchange them between my Linux and somebody else'Apple and Microsoft. But as is my experience with Linux when I have a problem Linux users come up with several solutions in no time. Thanks for the tips everybody how I can use spaces anyway.

But do these solutions (to still easily use spaces in linux files) still work when these Linux files have to be read by Windows or Apple?
gm10

Re: This newbie has overcome his fear of the terminal

Post by gm10 »

carum carvi wrote: Fri Nov 02, 2018 5:16 amBut do these solutions (to still easily use spaces in linux files) still work when these Linux files have to be read by Windows or Apple?
Both of those handle spaces just the same.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: This newbie has overcome his fear of the terminal

Post by rene »

For compatibility with NTFS (and VFAT and exFat) avoid these characters in filenames that are legal on UNIX: all characters with ASCII value less than 32 and value 127 (control characters) and \ * ? % : | < > "

Forward slash / is not allowed on UNIX by being the directory separator, and in fact not on Windows either where it's interchangeable with the disallowed backslash separator. Trailing periods or spaces also won't do.

With a possible exception for : I would suggest to avoid the above list \ * ? % : | < > " on UNIX as well and would add single quote '. Space I would not avoid, certainly not for e.g. music, but that means quoting and that means you really are best off without " or '.
aes2011
Level 4
Level 4
Posts: 498
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 »

carum carvi wrote: Thu Nov 01, 2018 6:41 am My first lesson with the Linux Command Line PDF was a warning NOT to use spaces in filenames.
Here's at least one mention (on page 36 of OP's reference):
4.Though Linux supports long filenames which may contain embedded spaces
and punctuation characters, limit the punctuation characters in the names of
files you create to period, dash, and underscore. Most importantly, do not em-
bed spaces in filenames
. If you want to represent spaces between words in a
filename, use underscore characters. You will thank yourself later.
Of course, one will learn more, as Yoda teaches us, by using all sorts of characters in filenames :mrgreen:
User avatar
lsemmens
Level 11
Level 11
Posts: 3949
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: This newbie has overcome his fear of the terminal

Post by lsemmens »

I "grew up" with 8.3 filenames. When Long filenames were introduced in Windwoes way back when I did embrace it, however, I did not use a long filename to write "War and Peace". I will generally store files in folders related to the topic at hand. Even if that folder only contains one or two files. e.g. 2010Reconciliation contains all files related to that process. I do the same with all my music, Firstly grouped by music genre then by artist, then a subfolder of album. Much neater than RockPinkFloydTheWallTheWall . Isn't /Rock/PinkFloyd/TheWall/TheWall much neater?
Fully mint Household
Out of my mind - please leave a message
gm10

Re: This newbie has overcome his fear of the terminal

Post by gm10 »

lsemmens wrote: Fri Nov 02, 2018 8:26 am I "grew up" with 8.3 filenames. When Long filenames were introduced in Windwoes way back when I did embrace it, however, I did not use a long filename to write "War and Peace". I will generally store files in folders related to the topic at hand. Even if that folder only contains one or two files. e.g. 2010Reconciliation contains all files related to that process. I do the same with all my music, Firstly grouped by music genre then by artist, then a subfolder of album. Much neater than RockPinkFloydTheWallTheWall . Isn't /Rock/PinkFloyd/TheWall/TheWall much neater?
Dunno, it would be Pink Floyd - The Wall on my system, I find that much easier on the eyes. But I believe the point has been made: There's no technical reason not to use spaces in file names. You are free to name your files whichever way you prefer. Nothing more to say really.
User avatar
Portreve
Level 13
Level 13
Posts: 4870
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Re: This newbie has overcome his fear of the terminal

Post by Portreve »

I don't really think much of the mindset or mentality which promotes the idea of sticking with tradition or habit or "what you know" over thinking for oneself, and honestly I have little use for those persons who function in that way, whether in the technology world or elsewhere.

There are certain specialized places and situations where one should not use spaces; however, generally, spaces are appropriate and make things, as has been alluded to above, much more human friendly. Can you imagine trying to read a newspaper where they didn't use spaces?

I use the terminal from time to time to accomplish certain specific tasks, but I operate on the desktop, so why spaces should be a problem, as far as I'm concerned, is normally just people preferring dogma over having to use their brain and think about what's actually appropriate for the situation.

Just my 2¢.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
aes2011
Level 4
Level 4
Posts: 498
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 »

Portreve wrote: Sat Nov 03, 2018 7:45 am I don't really think much of the mindset or mentality which promotes the idea of sticking with tradition or habit or "what you know" over thinking for oneself, and honestly I have little use for those persons who function in that way, whether in the technology world or elsewhere.

There are certain specialized places and situations where one should not use spaces; however, generally, spaces are appropriate and make things, as has been alluded to above, much more human friendly. Can you imagine trying to read a newspaper where they didn't use spaces?

I use the terminal from time to time to accomplish certain specific tasks, but I operate on the desktop, so why spaces should be a problem, as far as I'm concerned, is normally just people preferring dogma over having to use their brain and think about what's actually appropriate for the situation.

Just my 2¢.
What has reading newspapers got to do with a newcomer to the command-line?
Locked

Return to “Open Chat”