How to access an directory with spaces


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to access an directory with spaces
# 1  
Old 01-26-2009
How to access an directory with spaces

I am getting an error while trying to access a directory created with spaces in between, i couldn't able to login into that directory could you please suggest me what should i do to access that directory or if i want to rename that directory what should i do.

Code:
Directory Name:
MH PLR 2005 Regional Input

Thanks & Regards,
Ariean.
# 2  
Old 01-26-2009
Hammer & Screwdriver put the directory inside quotes

Code:
cd "MH PLR 2005 Regional Input"

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Finding files older than x days within directory with spaces

Hi, I am trying to run a command that finds all files over x amount of days, issue is one of the directories has spaces within it. find /files/target directory/*/* -type f -mtime +60 When running the above the usual error message is thrown back + find '/files/target\' 'directory/*/*' -type... (1 Reply)
Discussion started by: Ads89
1 Replies

2. Shell Programming and Scripting

Help with reading directory paths with spaces from a file

Hi I want to know how to handle the spaces in the below scenario. I have a file (CON_zip_path_1.txt) which has some directory paths with spaces in directory names . My requirement is to unzip these zip files to another path. Please see the code below and the error. CON_zip_path_1.txt... (4 Replies)
Discussion started by: paul1234
4 Replies

3. Shell Programming and Scripting

Proper way to use a path with spaces in the directory name

I am using the below bash loop: or f in /media/cmccabe/My Book Western Digital/10_29and30_2015/*.bam ; do bname=`basename $f` pref=${bname%%.bam} samtools view -H $f | sed '/^@PG/d' | samtools reheader - $f > /home/cmccabe/Desktop/NGS/${pref}_newheader.bam done is the... (1 Reply)
Discussion started by: cmccabe
1 Replies

4. Ubuntu

No access to etc directory

Hi, I'm new to this... but I am unable to see /etc, however I can access it via gknautilus... but as superuser I'm getting told no such file or directory via terminal (15 Replies)
Discussion started by: GaryW
15 Replies

5. Shell Programming and Scripting

Shell Script to Enter a Directory (Folder Name Contains Spaces)

I am writing a shell script to cd to a folder. folder name is "October Scripts" I am currently storing the name of folder in a shell variable as so path="October\ Scripts/". If I do cd $path I receive the error bash: cd: October\: No such file or directory What am I doing wrong? Kindly... (3 Replies)
Discussion started by: anand2308
3 Replies

6. Shell Programming and Scripting

Handling directory with spaces in for loops

Hi everyone, I have been a big fan here since a couple years (since I started being an admin ...) and finally decided to become a member and help ppl and perhaps being helped Now I have a problem that might interest some of the gurus. I am abig fan of what I call "one liners". I am trying... (2 Replies)
Discussion started by: plmachiavel
2 Replies

7. UNIX for Dummies Questions & Answers

Problem with spaces in directory path

Hi Gurus, I have a requirement. cat /usdd/Sample/"NDDF Plus DB"/"NDDF Descriptive and Pricing"/"NDDF BASICS 3.0"/"Pricing"/1.txt | sed 's/*|*/|/g' | sed 's/^*//'| sed 's/^*//; s/*$//' > temp.txt In unix prompt the above command is reading the file 1.txt and I am... (1 Reply)
Discussion started by: prabhutkl
1 Replies

8. Shell Programming and Scripting

moving files with spaces in filename from one directory to another

Hello, When I run following script #!/bin/bash cd ~/directory1 mv `ls -trF | grep -v / | tail -10 ` ~/directory2 works fine with filenames not having any space but runs into issues with filenames that have spaces tried with $file variable still doesnot work. Can someone help me (4 Replies)
Discussion started by: asakhare
4 Replies

9. UNIX for Advanced & Expert Users

Recusive Directory Permissions with Spaces

Ok, I think it would be wise to begin with the scenario. I've got a server that has a template directory structure containing 7 folders. Some folders will need permissions set one way, and other set another way. That's the easy part using: chmod -R 755 * ;This used first to... (2 Replies)
Discussion started by: Junk_box9
2 Replies

10. Shell Programming and Scripting

Directory names that contain spaces and other suggestions?

The script below was written to select files and convert a particular string to something other and replace that file. However, I came across some issues with filenames that contain spaces, any suggestions to get around this? Any other suggestions that may apply to this code would also be... (5 Replies)
Discussion started by: Shakey21
5 Replies
Login or Register to Ask a Question