d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Linux Homework
Add Reply New Topic New Poll
Member
Posts: 16,059
Joined: Sep 3 2006
Gold: 1,135.00
Oct 9 2017 05:33pm
The path i'm working in is /home/intro112/start/2 directories (dir-and dir-b)2 files (Newfile-a and file-b)

Home
Intro112
Start
Dir-a & Dir-b
2 files in Dir-a (Newfile-a & File-b)


(These aren't in order)
1.) (I'm in dir-a) It's asking me to move new-filea to dir-b.
My answer: mv newfile-a /home/intro/start/dir-b
Could I instead do: mv newfile-a ../dir-b

2.) (I'm in dir-a) It's asking me to display start directory contents without moving to the start directory.
My answer: ls /home/intro112/start
Could I do : ls ..

3.) (I'm in dir-a) Move file-b to dir-b and rename the file to new-fileb
Not sure about this one

I'm a little confused about the . and .. commands, in my book it says that . will keep you in the working directory, and .. to mean the parent directory. Do you only want to use dots when you plan on actually moving to that directory?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 9 2017 06:40pm
Quote
Could I instead do: mv newfile-a ../dir-b
Could I do : ls ..


i'm not sure i understand why you're asking those questions. don't you have access to a computer where you can try them out? but to answer your questions, yes.

Quote
3.) (I'm in dir-a) Move file-b to dir-b and rename the file to new-fileb
Not sure about this one


mv file-b ../dir-b/new-fileb

Quote
Do you only want to use dots when you plan on actually moving to that directory?


No. they're relative path, so anytime you want to reference a directory, it works.

This post was edited by carteblanche on Oct 9 2017 06:40pm
Go Back To Homework Help Topic List
Add Reply New Topic New Poll