Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a directory /f/ssh which I would like to turn into /f/.ssh. I'm working with git-bash on win7 I've tried:
/f
$ mv /ssh /.ssh
mv: cannot stat `/ssh': No such file or directory
/f
$ mv ssh .ssh
mv: cannot move `ssh' to `.ssh/ssh'
But its not working. How can I make this happen ?
You probably want your second example (current working directory) and not root (/).
$ mv ssh .ssh
mv: cannot move `ssh' to `.ssh/ssh'
What this is saying is there is already a folder called ".ssh" in your current working directory.
By calling that command again it's also saying you don't have access to move "ssh" into the already existing ".ssh" folder.
Try an ls -al to list all current files/folders in the directory, including hidden.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I know each part of this command.
sudo mv home/* *
sudo: super-user do, execute with root privileges.
mv: move a file or directory.
home/*: argument of mv command. It indicates the content of home directory. The asterisk * is a wildcard that expands to the list of files in the current directory in lexicographic order.
The next argument is the destiny folder. However, I specify an asterisk as destiny directory, and if I execute the command the folder disappear completely. So, what does the * in this case?
Let's say you have /home/userA, /home/userB and /home/userC. Let's further say you're running this in a directory that contains 1.txt, 2.txt, and a directory 3.d.
Under those circumstances, this would expand to:
sudo mv /home/userA /home/userB /home/userC 1.txt 2.txt 3.d
That is to say, both globs are expanded -- the first to the list of entries in /home, an the subject to the list of files in the current working directory -- and the result is everything being moved into the directory 3.d.
Flagged Community Wiki since this is an answer to an off-topic question.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I am currently taking a Computing GCSE, and I have got a Linux Controlled Assessment, and this is one of the tasks:
Create a directory within your home directory. Name it A452. Navigate to your new A452 directory. Type touch mynametextfile, where myname is your
first name.
I tried adding a new folder called A452, and then opening the terminal and typing touch matthewtextfile, but that didn't work. I am very new to Linux, and I tried Wikipedia, so what should I do?
Edit: It turns out that it was in my Home folder, not my newly created one!
try this in your terminal:
$ cd ~ # move to your home directory
$ mkdir A452 # create directory named A452
$ cd A452 # mv to that directory
$ touch mynametextfile # create file "mynametextfile"
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I just gotten a Raspberry Pi for Christmas and I wanted to delete some built in programs because I wanted to make a Linux server for home use. So far I had to do this all the time using the terminal because to delete the files, you had to use root.
rm ./files/*
rmdir files
Is there any way I can use rmdir command when there are files in it?
rm -rf files will remove the files directory and all subdirectories and not prompt you with questions about file permissions.
Sure just recursive delete :)
rm -r files
In your terminal, change directories to the one in the hierarchy just above the directory in question. Then:
$mv ./dir_to_del/* .; rmdir ./dir_to_del
This will move all the files out of the directory you want to delete, and then delete the now-empty folder.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Operating system: SLES12 VM
So I start off in a directory:
DirA: /home/user/testA/testB
My goal is to move a file from this directory to a directory given by
DirB_rel: /home/user/testA/testB/../../deliverables/rpm/SOURCE
Note: testA is a symlink which is not included in DirB_abs
Which, when I cd to it, gives a pwd of
DirB_abs:/home/user/deliverables/rpm/SOURCE
The problem is, when I try move a file using mv (have tried tar.gz and .txt) from DirA to DirB_rel, the file is deleted from original location as expected, but it does not appear at new location and is therefore lost.
E.g. mv testFile.txt DirB_rel -> File disappears
However, when I use the absolute path for directory B, mv works correctly.
E.g. mv testFile.txt DirB_abs -> Success
Any idea whats going on here?
Thanks!
The problem is with the symlink. When you do user/testA/testB/../../ and testA is asymlink, you wont go back to user, but to the parent directory of the directory testA links to
the mv command will reference the directory you are currently in and not from where the file is. So if we are in home ~/ and want to move ~/A/file to ~/B/file you use mv as follows:
mv A/file B/
Note that if you use this
mv A/file ../B/
the command will look for B in /home/B and not ~/B since we are in the ~/ directory issuing the command.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am attempting to use the Unix Command rmdir to delete a directory, but I keep getting a message:
pwd
/Users/jona/Documents/Unix-Practice
$ rmdir Unix-Practice
rmdir: Unix-Practice: No such file or directory
I am also doing this to see if I need to be above the directory to be deleted:
$ cd ..
$ pwd
/Users/jona/Documents
$ rmdir Unix-Practice
rmdir: Unix-Practice: Directory not empty
Am I using the command improperly?
I am learning from this guide http://cli.learncodethehardway.org/book/ex7.html and it is telling me to use rmdir
It seems that your directory contain some files, when directory is empty then use rmdir.
From the man page of rmdir
rmdir - remove empty directories
Remove the DIRECTORY(ies), if they are empty.
Use:
rm -r Unix-Practice to delete directory with files