-
Command Line Basics - When to Use Spaces???
Just getting into linux, and it's been years since DOS command line stuff. I can't recall why or when to use spaces in command line entries. Is it optional, it doesn't seem that way. What's the rule for spaces, especially before or after the slash (/) marks?
Thanks.
-
Senior Member
registered user
ok space is between the comand and a flag and between flag and whatever.
like in ls -a which is ls+space+-a+spcae+/home/username/, same with just the comand. just one space like so
which is ls+space+/home/username
if you have space in a pathname, like:
ls -a /home/username/my files
you get errors. that is because it looks for a comand called files. if the space is before a / like :
ls -a /home/username/my files /new
that will be seen as new directory to list.
you can overcome this by using "\" like so:
Code:
ls -a /home/username/my\ files\ /new
or telling the comand that it should treat everything like one lump like so:
Code:
ls -a "/home/username/my files /new"
there are other ways aswell.
i hope this is what you wanted to know, if not keep asking.
-
Thanks, your examples were very good, and I'm clearer on when to use spaces or not. I'm getting a couple cheat sheets on bash commands to further help. Now I've got to find out if installing Knoppix off CD to hard disk is similar to installing something like Xanrdos, PCLinuxOS, etc (re easier for new users).
Similar Threads
-
By teccim in forum Hdd Install / Debian / Apt
Replies: 8
Last Post: 06-14-2005, 04:09 PM
-
By greygooseplz in forum General Support
Replies: 1
Last Post: 11-25-2004, 05:58 AM
-
By Jesse in forum Hdd Install / Debian / Apt
Replies: 8
Last Post: 04-30-2004, 05:57 PM
-
By wilsondk in forum General Support
Replies: 2
Last Post: 02-18-2004, 10:04 PM
-
By Ambrose in forum General Support
Replies: 1
Last Post: 08-08-2003, 02:17 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$100.00

Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot
$549.00

SSD 880EVO SATA III 2.5 4TB INTERNAL SOLID STATE DRIVE
$189.99

Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive -
$39.99

Crucial MX500 250GB 2.5" SATA III SSD - Preowned
$29.00

Crucial MX500 1TB 2.5" SATA III Internal SSD CT1000MX500SSD1
$99.99

2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON
$28.00

Fanxiang 256GB 512GB 1TB 2TB 4TB SSD Lot 2.5'' SATA Internal Solid State Drive
$42.99

Samsung 860 EVO 250GB, SATA III, 2.5" Internal Solid State Drive - Black...
$30.00

Intel Solid-State Drive DC S3500 Series 240GB Internal 2.5" (SSDSC2BB240G4P) SSD
$29.99