Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

SOLVED...mv and cd commands...

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
ramblin
Posts: 46
Joined: 2017-07-26 01:45

SOLVED...mv and cd commands...

#1 Post by ramblin »

I thought I better ask this in a new thread before I mess everything up. I was trying to move a folder named " DWA-160_REVB_DRIVERS_1.610_LINUX" to my src folder. Instead I moved my src folder inside the "DWA-160_REVB_DRIVERS_1.610_LINUX" folder. I tried several times to move it back but thankfully I got errors. Can I move it back or can I create a new src folder inside the usr folder. I`m having a hard time wrapping my head around the cd and mv commands. Everything I study about them is over my head. This is my original command that messed it up. Thanks

Code: Select all

mv -t /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX /usr/src/
Last edited by ramblin on 2018-06-03 12:22, edited 1 time in total.

User avatar
Ardouos
Posts: 1075
Joined: 2013-11-03 00:30
Location: Elicoor II
Has thanked: 1 time
Been thanked: 4 times

Re: mv and cd commands...

#2 Post by Ardouos »

ramblin wrote:I thought I better ask this in a new thread before I mess everything up. I was trying to move a folder named " DWA-160_REVB_DRIVERS_1.610_LINUX" to my src folder. Instead I moved my src folder inside the "DWA-160_REVB_DRIVERS_1.610_LINUX" folder. I tried several times to move it back but thankfully I got errors. Can I move it back or can I create a new src folder inside the usr folder. I`m having a hard time wrapping my head around the cd and mv commands. Everything I study about them is over my head. This is my original command that messed it up. Thanks

Code: Select all

mv -t /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX /usr/src/
In the man page:

Code: Select all

-t, --target-directory=DIRECTORY
              move all SOURCE arguments into DIRECTORY
AKA you:

moved /usr/src/

into /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX

as /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX is the target directory.
There is only one Debian | Do not break Debian | Stability and Debian | Backports

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: mv and cd commands...

#3 Post by Wheelerof4te »

If unsure, it's best to use your file manager for moving directories.

ramblin
Posts: 46
Joined: 2017-07-26 01:45

Re: mv and cd commands...

#4 Post by ramblin »

ardouos, I read the man before I tried this and thought /home/heatlocke/downloads/ was my target I was trying to send to usr/src.
I still have no idea how to proceed to put it back. How do I move with file manager ? I tried that first but options in the menus were not highlighted.

UPDATE: While following this logic to put things back I managed to delete the src folder completley. Nothing in there I needed any way. Now I just need to create a new src folder in usr.

arzgi
Posts: 1185
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: mv and cd commands...

#5 Post by arzgi »

ramblin wrote:ardouos, I read the man before I tried this and thought /home/heatlocke/downloads/ was my target I was trying to send to usr/src.
I still have no idea how to proceed to put it back. How do I move with file manager ? I tried that first but options in the menus were not highlighted.
/usr/src is owned be root, so file manager does allow acces to them as normal user.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: mv and cd commands...

#6 Post by bw123 »

ramblin wrote: ...
I`m having a hard time wrapping my head around the cd and mv commands. Everything I study about them is over my head.
Mayb try the first few modules at

https://linuxzoo.net/

It's pretty interesting.
resigned by AI ChatGPT

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: mv and cd commands...

#7 Post by debiman »

Code: Select all

cd /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX
sudo mv src /usr/
for obvious reasons i could not test this, so no guarantees.
might want to make a backup first.

i agree with previous posters, if cp and mv are "over your head" you should use a handholding distro like ubuntu and leave well enough alone - at least until you have learned a little more.

ramblin
Posts: 46
Joined: 2017-07-26 01:45

SOLVED re : mv and cd commands...

#8 Post by ramblin »

ramblin wrote: UPDATE: While following this logic to put things back I managed to delete the src folder completley. Nothing in there I needed any way. Now I just need to create a new src folder in usr.
Thanks debiman and the rest of you trying to help. For obvious reasons this won`t help me now since there is nothing left to move. But I have studied hard and managed to solve my problem myself. Didn`t copy the commands but as root I "cd" to /usr/. Then run mkdir src and it worked ( well not right off, or even the 2nd or 3rd time but I figured it out).
debiman wrote: i agree with previous posters, if cp and mv are "over your head" you should use a handholding distro like ubuntu and leave well enough alone - at least until you have learned a little more.
I appreciate everyone looking out for me but I`m not one to sit and ask questions and expect everyone to solve my problems. My opinion is this is a test build and a learning process for me. If I mess it up so bad it won`t boot, (did it already loading wrong headers] I will learn from fixing it (did it, recovery mode, removed it all ] and I will know more in the end. Not always a good plan for everyone. Thanks guys !

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: SOLVED re : mv and cd commands...

#9 Post by debiman »

ramblin wrote:I`m not one to sit and ask questions and expect everyone to solve my problems.
i wonder why you started this thread then.
a simple

Code: Select all

man mv
should've given you 90% of the answers you need (preferably before executing a command with superuser privileges), and a few simple web searches would've done the rest.
My opinion is this is a test build and a learning process for me. If I mess it up so bad it won`t boot, (did it already loading wrong headers] I will learn from fixing it (did it, recovery mode, removed it all ] and I will know more in the end.
ok.
we love to get pestered by clueless noobs which we then can slap around a bit.
but you should have mentioned the "not-mission-critical, i'm just messing around" bit right at the beginning.
but wait, maybe you'd have gotten fewer answers then?
because everybody thought that they're actually helping you with a real problem?

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: mv and cd commands...

#10 Post by RU55EL »

ramblin wrote:I thought I better ask this in a new thread before I mess everything up. I was trying to move a folder named " DWA-160_REVB_DRIVERS_1.610_LINUX" to my src folder. Instead I moved my src folder inside the "DWA-160_REVB_DRIVERS_1.610_LINUX" folder. [...]

Code: Select all

mv -t /home/heatlocke/Downloads/DWA-160_REVB_DRIVERS_1.610_LINUX /usr/src/
Looking at the man file:

Code: Select all

MV(1)                                           User Commands                                           MV(1)

NAME
       mv - move (rename) files

SYNOPSIS
       mv [OPTION]... [-T] SOURCE DEST
       mv [OPTION]... SOURCE... DIRECTORY
       mv [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
       Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
If you had not used the -t switch it probably would have worked as you expected. The difference between the mv command with and without the -t switch is that the source and directory are transposed.

ramblin
Posts: 46
Joined: 2017-07-26 01:45

Re: SOLVED re : mv and cd commands...

#11 Post by ramblin »

debiman wrote:ok.
we love to get pestered by clueless noobs which we then can slap around a bit.
but you should have mentioned the "not-mission-critical, i'm just messing around" bit right at the beginning.
but wait, maybe you'd have gotten fewer answers then?
because everybody thought that they're actually helping you with a real problem?

Wow, that pretty rough. It was never my intent to pester anyone. At the time I asked the question I really I had studied the man pages. I had googled my problem for hours. Has it occured to you that 95% of the info on the subject petains to other distros and is often incorrect. I don`t get it. If we ask questions we are clueless noobs pestering everyone. If I try and solve it myself " i'm just messing around". That OK, I`m a big boy and I can take being slapped around a bit and I will learn from it. I doubt I`ll be around though, I expect to be banned for speaking out.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: SOLVED...mv and cd commands...

#12 Post by bw123 »

There are several good "cheat sheets" for basic linux commands. linux+tutorials would also be a good search.

https://duckduckgo.com/html/?q=linux+cheat+sheet

I sort of think the difference between the two styles of providing options can be confusing. There is a single dash -t that uses no equal sign
-t /target

or the way I usually prefer, but it takes more typing.

--target-directory=/target

I wish I could just pick one style and stick with it, but some commands do not have a full set of both styles for all options.
Last edited by bw123 on 2018-06-03 12:54, edited 1 time in total.
resigned by AI ChatGPT

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: SOLVED...mv and cd commands...

#13 Post by sunrat »

Everyone makes mistakes. I once accidentally changed ownership of my whole main system to my user while booted into another OS. That was unfixable.
That said almost every question is already answered somewhere on the internet or in man pages or docs, although they can be hard to understand at times. Finding the answer there is much more educational than posting in a forum and will avoid the wrath of the hardline members.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

ramblin
Posts: 46
Joined: 2017-07-26 01:45

Re: SOLVED...mv and cd commands...

#14 Post by ramblin »

[quote="bw123"]There are several good "cheat sheets" for basic linux commands. linux+tutorials would also be a good search./quote]



Yes, cheat sheets are a must for me. Matter of fact I have 6 pages myself of notes in my own words between my 2 recent threads. Thanks for the help guys, I couldn`t have done it without you !

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: SOLVED re : mv and cd commands...

#15 Post by debiman »

ramblin wrote:
debiman wrote:ok.
we love to get pestered by clueless noobs which we then can slap around a bit.
but you should have mentioned the "not-mission-critical, i'm just messing around" bit right at the beginning.
but wait, maybe you'd have gotten fewer answers then?
because everybody thought that they're actually helping you with a real problem?
Wow, that pretty rough. It was never my intent to pester anyone. At the time I asked the question I really I had studied the man pages. I had googled my problem for hours. Has it occured to you that 95% of the info on the subject petains to other distros and is often incorrect. I don`t get it. If we ask questions we are clueless noobs pestering everyone. If I try and solve it myself " i'm just messing around". That OK, I`m a big boy and I can take being slapped around a bit and I will learn from it. I doubt I`ll be around though, I expect to be banned for speaking out.
so, you twist my words and victimize yourself.
not that i haven't seen that one coming.

try to see it from our way: i think, oh, this newb's lost some files because didn't know how to use mv/cp, let's help them! i do invest a little time and effort in this - mind you, real time and effort, not virtual - only to be told: nevermind, this is not mission critical anyway (often also something like: "i already reinstalled" or "i deleted the vm").

it doesn't feel good: helping someone who then says they didn't need it anyway.

remember, it was you who told us off for trying to help you, bringing in the "test build" (a.k.a. "messing around") argument:
I appreciate everyone looking out for me but I'm not one to sit and ask questions and expect everyone to solve my problems. My opinion is this is a test build and a learning process for me. If I mess it up so bad it won't boot, (did it already loading wrong headers] I will learn from fixing it (did it, recovery mode, removed it all ] and I will know more in the end. Not always a good plan for everyone. Thanks guys !
well, at least you said thank you.
and it seems you have indeed learned something - hopefully not only on the technical level.

and now i feel a little conciliatory, so i'll add: you are by far not the only one doing this, maybe you got the brunt of my frustration from a dozen previous posters.

ramblin
Posts: 46
Joined: 2017-07-26 01:45

Re: SOLVED...mv and cd commands...

#16 Post by ramblin »

debiman, You help a lot of folks on this forum and you really tried to help me and I appreciate that. As noobs after hours of frustration, trying things that don`t work, messing stuff up worse we reach out in the wrong way, sometimes sitting by our terminal waiting for an answer. I should have thought that thru a little more. But I fixed my problem and I learned a lot about using these commands. I am totally impressed with Debian and wouldn`t go with any other distro now. Problem is after all those years, getting that Windows way of thinking out of your head......

Post Reply