LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2020, 12:18 PM   #1
SplitConsciousness
LQ Newbie
 
Registered: Oct 2020
Posts: 3

Rep: Reputation: Disabled
Terminal says my directory (?) is not a directory


ookleuk@ookleuk-Swift-SF314-55:~/Documents$ mv Geheimhoudingsverklaring LSM RA.odt /Place
mv: target '/Place' is not a directory
ookleuk@ookleuk-Swift-SF314-55:~/Documents$ ls
'Geheimshoudingsverklaring LSM RA.odt' Place 'Python notes.odt'

As you can see, I'm trying to move the file 'Geheimshoudingsverklaring LSM RA.odt' into the Place directory. How come the terminal tells me it's not a directory? How should I move it then?
 
Old 10-20-2020, 12:24 PM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Where is the "Place" directory, under your user's /home directory? The command you referenced attempts to move the file to a directory under "/" which is the root of the OS. You probably want the document to be moved under ~/Place, not /Place.
 
Old 10-20-2020, 01:52 PM   #3
SplitConsciousness
LQ Newbie
 
Registered: Oct 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sevendogsbsd View Post
Where is the "Place" directory, under your user's /home directory? The command you referenced attempts to move the file to a directory under "/" which is the root of the OS. You probably want the document to be moved under ~/Place, not /Place.
Ahh, that must be it then. The 'Place' directory is within the 'Documents' folder (it is not directly located under 'home'). The path should be /home/ookleuk/Documents/Place. How would replacing the 'Geheimshoudingsverklaring LSM RA.odt' to the 'Place' folder work syntax-wise?
 
Old 10-20-2020, 02:39 PM   #4
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
So, based on your first post, should be this:
Code:
mv Geheimhoudingsverklaring LSM RA.odt ~/Documents/Place
provided you are in the directory where that document is located. If not, then you'll have to reference the source and destination directory full paths.
 
Old 10-20-2020, 03:48 PM   #5
Hermani
Member
 
Registered: Apr 2018
Location: Delden, NL
Distribution: Ubuntu
Posts: 261
Blog Entries: 3

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by sevendogsbsd View Post
So, based on your first post, should be this:
Code:
mv Geheimhoudingsverklaring LSM RA.odt ~/Documents/Place
provided you are in the directory where that document is located. If not, then you'll have to reference the source and destination directory full paths.
I am not sure that your reply is completely correct. File names with spaces need special handling, otherwise the command can give unexpected results.

Please read this article about how to handle file names with spaces.

I think the correct command should be
Code:
mv Geheimhoudingsverklaring\ LSM\ RA.odt ~/Documents/Place
Personally if I would be in the home directory I would issue the command this way
Code:
mv ./Geheimhoudingsverklaring\ LSM\ RA.odt ./Place
this way I am sure that the file is coming outof the current directory and the directory called "Place" is located below the current directory.

Also I learned to use filenames without spaces and use underscores instead
Code:
touch Dit_bestandje_maak_ik_zo.txt

Last edited by Hermani; 10-20-2020 at 03:52 PM.
 
2 members found this post helpful.
Old 10-20-2020, 06:22 PM   #6
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
or try to enclose in quotes.

Quote:
mv "Geheimhoudingsverklaring LSM RA.odt" ~/Documents/Place
 
3 members found this post helpful.
Old 10-20-2020, 09:16 PM   #7
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Or mv Gehe<tab>, depending on how many documents starting with Geheimhoudingsverklaring are in the directory. Bash will autocomplete the filename, and insert the proper escape characters for you. To me, that's the easiest way to get any filename, but especially for files with odd characters in the name. I seldom type the full name of any file, and my Tab key gets used a lot.
 
3 members found this post helpful.
Old 10-21-2020, 05:43 PM   #8
pwnrz
LQ Newbie
 
Registered: Oct 2020
Location: The east coast
Distribution: Ubuntu 20.04
Posts: 2

Rep: Reputation: Disabled
Instead of doing "/Place", do Place. If you do /Place, it'll think it's in the system's main directory (where stuff like the home & usr directory is stored). Hope this helps.
 
Old 10-23-2020, 04:42 AM   #9
SplitConsciousness
LQ Newbie
 
Registered: Oct 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
It turns out there was a typo in the filename, apparently :')

The command that made it work was mv Geheimshoudingsverklaring\ LSM\ RA.odt ~/Documents/Place

The typo was in the 's' behind 'Geheim'

Thanks for the help still, and also thanks for that useful article on spaces in file names!

Last edited by SplitConsciousness; 10-23-2020 at 04:45 AM.
 
1 members found this post helpful.
Old 10-23-2020, 05:21 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by SplitConsciousness View Post
It turns out there was a typo in the filename, apparently :')

The command that made it work was mv Geheimshoudingsverklaring\ LSM\ RA.odt ~/Documents/Place

The typo was in the 's' behind 'Geheim'

Thanks for the help still, and also thanks for that useful article on spaces in file names!
In this specific case, this:
Code:
mv Geheimshoudingsverklaring\ LSM\ RA.odt Place
(or variations as per above) would've sufficed.
Tip: use <tab>completion: hit <tab>key twice to see what's possible. Type the first letter, hit <tab>twice again...
 
1 members found this post helpful.
Old 10-23-2020, 01:40 PM   #11
Hermani
Member
 
Registered: Apr 2018
Location: Delden, NL
Distribution: Ubuntu
Posts: 261
Blog Entries: 3

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by SplitConsciousness View Post
Thanks for the help still, and also thanks for that useful article on spaces in file names!
If you're satisfied with the answers please mark your thread als "SOLVED"

and stay healthy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Login page says account reached max attempts but lchage says not locked hrricane34 Linux - Newbie 1 10-09-2013 01:01 AM
WICD tray icon says not connected, WICD manager says conneted to wired network?!?! intheshadows Linux - Newbie 1 12-24-2009 12:15 PM
Network says disabled - gui says enabled.. not internet tiger.woods Ubuntu 5 02-09-2009 10:09 AM
rpm -ivh says installed rpm -e says not installed ??? skog Fedora 3 12-22-2004 03:52 PM
Everybody says SiS M650 chipset does not support DRI, but nobody says why mikeyt_333 Linux - Hardware 2 04-10-2004 11:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration