Rmdir -r

hi guys, im trying to get rid of a non empty directory. i have researched it online and it basically says that the command would be sudo rmdir -r filename
it keeps coming back with invalid option for r

what am i doing wrong?

the directory is in the home directory along with the documents, videos, download etc and i am in the home directory. i tried putting a text file there to make sure i am in the right path and it deleted it with rm so the path is correct.

i understand that i can do it with the gui but im trying to learn the terminal for the next forty years.

any suggestions would be greatly appreciated.


Similar Content



More Command

hi guys, im having terminal trouble.

i have a libre word file called lintest.odt in the Documents directory (folder). I want to move it to the Libre directory (folder).

Desktop Downloads Libre Pictures Templates
Documents home Music Public Videos


from the root directory i typed cd Documents and then pwd and I got
/home/francis/Documents
i then typed ls and i got lintest.odt

I then typed mv lintest Libre and it says

mv: cannot stat ‘lintest’: No such file or directory

what am I doing wrong?

when i try to see the contents of the lintest file with more lintest
I got ~/Documents$ more lintest.odt
PK
�F^�2^L'
--More--(0%)
and then it locks up the terminal.

im obviously doing something dreadfully wrong.

Why ./home/Desktop Is Incorrect And ./Desktop Is Correct?

I'm learning about Linux, started yesterday. I have a question which didn't clear from the book and Google. The question is what is the difference between ./ and / in terminal? I'm asking this because when i give command for example - ./home/yogesh/Desktop/Books it is showing bash: ./home/yogesh/Desktop : No such file or directory but on removing the dot it's showing /home/yogesh/Desktop/Books: Is a directory.
Again on giving command like /Desktop it showing /Desktop :No such file or directory but on adding dot before / it is giving ./Desktop: is a directory.
What is the difference between ./ and / ?
I'm sorry if i asked something foolish but I have to know it anyway. Thankyou in advance and sorry for my bad English.

What Exactly Is PATH

books say that PATH variable contains the locations where the shell searches the commands to execute them.

I created a shell script and saved it in /home/user/Downloads directory and then i ran this script from the /home/user/Downloads directory. It did not execute.

however when i did set the path
export PATH=$PATH:/bin/sh within /home/user/Downloads directory, the shell script executed. Does it not mean that PATH variable is holding the locations of the shell program rather than the commands that are to be executed?

everytime i have to give the location of the shell i.e /bin/sh in the PATH variable no matter from where i am executing my script

Did I Just Rm -rf My Entire Home Dir? (data Recovery)

Hi everyone, I hope you're all well, I've made a pretty stupid error and I hope someone can help, thanks for your time.

So, I had been warned by gnome and my package manager that my HDD was full which didn't seem right so I decided to look at Gnome's 'Disk Usage Analyzer' which made the problem appear obvious. There was apparently a complete 1.5TB copy of my home directory in the /srv/nfs/ directory, now I don't have much use for NFS anymore and I needed to install some software so I thought the solution was quite straightforward , I cd'ed to /srv/nfs/ and rm -rf'ed the directory and figured that I would fix nfs at a later date. Now this seems to have deleted my actual home directory, which is completely empty and it looks to me like I've lost ~1.5TB of data.
So firstly, Is it actually this operation which deleted my home directory or did I manage to do this at some other point with some other command?
And secondly do I have any chance of recovering files? I tried to unmount the partition when I realised what I had done but I kept getting an error to the effect that the drive was busy at which point I rebooted and got the same error, so I unplugged the machine. Googling led me to extundelete but I don't have access to another linux machine at the moment, would this be my best chance?

Thanks again for any replies.

Tips On Using Bash Script To Edit A Windows Text File

I have a bash script executing on an AIX server to a windows share directory to update a windows text file. Most of the file is edited as expected but I have 3 issues that I am not sure how to resolve.

1. Windows text file contains a double backslash (\\) and the \\ is being written back as a single \ which corrupts the file.
2. I am not getting the last line of text in the file written back out.
3. Some lines of text are not written back out completely.

Here is a snippet of my bash script:
cp $Directory/Somefile $Directory/Somefile.$(date +'%Y%m%d')
cat /dev/null > ${HOME}/temp.out

while read -r inpLine; do
patternFound=n
echo ${inpLine} | grep -q 'SOMEPATTERN='
if [ $? = 0 ]; then
patternFound=y
echo "##${inpLine}" >> ${HOME}/temp.out
echo "SOMEPATTERN=newValue" >> ${HOME}/temp.out
fi

if [ ${patternFound} = "n" ]; then
echo ${inpLine} >> ${HOME}/temp.out
fi

done < $Directory/Somefile
mv ${HOME}/temp.out $Directory/Somefile

Using The Teminal Command Line In Ubuntu 12.04 Lts

Stupid question i know. I am trying to install some brother printer drivers and following the instructions it states that i must change to the directory where the file is stored by using the following command line "cd /home/(loginname)/downloads"

this comes back with unkown directory. When i use DIR the directory is there but it will not allow me to access it?

This has worked before. I have been using linux now for a few years and never had this problem before. It must be something stupid that I am doing.

Bash: Cd/home/myname/pictures: No Such File Or Directory

I know that this question has been asked a number of times in the past, but I still can't find an answer. I typed in the following command in my terminal: cd/Home/Harold/Pictures (and I know all of these exist because I can see them) and I get the following response: Bash: cd/Home/Harold/Pictures: no such file or directory. Any ideas?

Error

Hi.. I was trying to patch a LEACH code on ns-2.34. During installation, I run the command 'make' and I've got some of the errors.

make[1]: Entering directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/dec'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/dec'
make[1]: Entering directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/epa'
make[1]: Entering directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'

Please help me to solve..

os arch - i686
os - ubuntu 10.04

Connecting To Specific Directory With Filezilla

Hello, I have an embedded linux device. I can connect to the device and I can upload or download files. No problem with this. But, at first connection, I want to connect to "/" directory instead of "/root". In the device file system, there are files ssh_config and sshd_config under /etc/ssh directory. I think I have to do something with these files but I don't know what.

I don't exactly know what mean "/root" and "/" directories. I think that the real root directory is "/" directory which is empty but when I connect with filezilla, the "/root" directory is the default so I had to go back to / directory everytime.

Hidden Folders And Files Become Viewable In Home Directory

Hi guys,
.
For no apparent actions from me, hidden folders and files show
in my /user/home directory, they are as follows:-

folders:
.adobe .cache .config .cups .filezilla .gimp-2.8 .gnupg .gphoto .gstreamer-0.10 .icedtea .java .local .macromedia .mozilla .pki .thumbnails

Files:
.bash_history .bashrc .esd_auth .ICEauthority

In my / directory
File: ./readahead

Seeking help to verify the above folder and files are not from a harmful source or application?

If they do not post any thread to the system, how can I conceal
these folders and files, so that they don't show up any more in
my home and / directory ?

Many thanks.