This newbie has overcome his fear of the terminal

Chat about just about anything else
carum carvi
Level 6
Level 6
Posts: 1029
Joined: Sun Apr 16, 2017 11:44 pm

This newbie has overcome his fear of the terminal

Post by carum carvi » Thu Nov 01, 2018 6:41 am

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...

deepakdeshp
Level 15
Level 15
Posts: 5813
Joined: Sun Aug 09, 2015 10:00 am

Re: This newbie has overcome his fear of the terminal

Post by deepakdeshp » Thu Nov 01, 2018 7:17 am

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, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.2 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

User avatar
xenopeek
Level 24
Level 24
Posts: 24096
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: This newbie has overcome his fear of the terminal

Post by xenopeek » 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.
Image

HaveaMint
Level 5
Level 5
Posts: 693
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in the USA
Contact:

Re: This newbie has overcome his fear of the terminal

Post by HaveaMint » Thu Nov 01, 2018 9:47 am

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
Selection_002.jpg (8.06 KiB) Viewed 704 times
"Tune for maximum Smoke and then read the Instructions".

gm10
Level 19
Level 19
Posts: 9165
Joined: Thu Jun 21, 2018 5:11 pm

Re: This newbie has overcome his fear of the terminal

Post by gm10 » Thu Nov 01, 2018 9:51 am

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 5
Level 5
Posts: 506
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 » Thu Nov 01, 2018 9:54 am

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 5
Level 5
Posts: 506
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 » 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

User avatar
Faust
Level 4
Level 4
Posts: 497
Joined: Thu Jul 14, 2016 3:40 am

Re: This newbie has overcome his fear of the terminal

Post by Faust » Thu Nov 01, 2018 10:07 am

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:
" And so it goes " - Kurt Vonnegut
The modern reality and the satirical parody are rapidly converging .

User avatar
absque fenestris
Level 6
Level 6
Posts: 1184
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 » Thu Nov 01, 2018 11:47 am

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...
Linux Mint 18.3 Sylvia (Mate) 32-bit - Acer D250 Netbook (Intel Atom N270, 2 GB RAM, 120 GB SSD)
Linux Mint 17.3 Rosa (Mate) 64-bit - MacBook Pro 15" (Intel Core2 Duo, 8 GB RAM, 240 GB SSD) - with some separation difficulties...

User avatar
majpooper
Level 5
Level 5
Posts: 940
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 » Thu Nov 01, 2018 9:58 pm

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 17
Level 17
Posts: 7175
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: This newbie has overcome his fear of the terminal

Post by Flemur » Thu Nov 01, 2018 10:21 pm

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.
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?
Mint 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

User avatar
xenopeek
Level 24
Level 24
Posts: 24096
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: This newbie has overcome his fear of the terminal

Post by xenopeek » Fri Nov 02, 2018 3:25 am

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
Level 6
Level 6
Posts: 1029
Joined: Sun Apr 16, 2017 11:44 pm

Re: This newbie has overcome his fear of the terminal

Post by carum carvi » Fri Nov 02, 2018 5:16 am

"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
Level 19
Level 19
Posts: 9165
Joined: Thu Jun 21, 2018 5:11 pm

Re: This newbie has overcome his fear of the terminal

Post by gm10 » Fri Nov 02, 2018 5:30 am

carum carvi wrote:
Fri Nov 02, 2018 5:16 am
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?
Both of those handle spaces just the same.

rene
Level 12
Level 12
Posts: 4152
Joined: Sun Mar 27, 2016 6:58 pm

Re: This newbie has overcome his fear of the terminal

Post by rene » Fri Nov 02, 2018 6:13 am

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 5
Level 5
Posts: 506
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 » Fri Nov 02, 2018 6:35 am

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 8
Level 8
Posts: 2428
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 » 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?
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

gm10
Level 19
Level 19
Posts: 9165
Joined: Thu Jun 21, 2018 5:11 pm

Re: This newbie has overcome his fear of the terminal

Post by gm10 » Fri Nov 02, 2018 8:46 am

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 8
Level 8
Posts: 2066
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida
Contact:

Re: This newbie has overcome his fear of the terminal

Post by Portreve » 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¢.
I'm so down wit' dat', yo, dass ich unter dem Beton bin.

Presently rocking LinuxMint 19.2 Cinnamon.

Remember to mark your fixed problem [SOLVED].

All in all, you're just another brick in the wall.

aes2011
Level 5
Level 5
Posts: 506
Joined: Wed Jul 06, 2011 10:39 pm

Re: This newbie has overcome his fear of the terminal

Post by aes2011 » Sat Nov 03, 2018 9:31 am

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?

Post Reply

Return to “Open chat”