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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-06-2005, 09:08 PM
|
#1
|
Member
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269
Rep:
|
Remove a Directory
Can anyone help me out by letting me know how to remove a directory using Command Line. I struggled to find the answer googling . & also what the command is 4 adding a file . I know how to add a directory= "mkdir /home/test" etc but not adding a file to a directory. Thanks (how 2 remove a Directory & how to add a file)
|
|
|
08-06-2005, 09:26 PM
|
#2
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Code:
rm /directory/name
rm -r /directory/name
rm -rf /directory/name
To 'add' a file, you can create an empty file using the 'touch' command.
|
|
|
08-06-2005, 09:55 PM
|
#3
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 65
Rep:
|
You can also use 'rmdir' to remove directorys. The nice thing about rmdir is that it makes sure the directory is empty. You might want to try to avoid using 'rm -rf' (or be careful with it at least) because it can be a very dangerous command, (especially if you're logged in as root). One of my friends accidentally typed 'rm -rf path/to/something *' while in the root directory (notice inbetween the something and the *, he typed a space where he intended to type a /) this caused him to accidentally begin deleting every file off of his hard drive.
As for creating fliles. In windows theres options like "create new text documet" and "create new bitmap image" in linux files are just files. I'm not sure why you would need to create a file though. For most things the easiest way would just to use the program that makes the file (the gimp for images, or a text editor for a text file) and then just save it to a specific location.
|
|
|
08-07-2005, 06:28 AM
|
#4
|
Member
Registered: May 2005
Posts: 378
Rep:
|
Quote:
To 'add' a file, you can create an empty file using the 'touch' command.
|
Or, if you don't like too much typing, just use
|
|
|
08-07-2005, 06:30 AM
|
#5
|
Member
Registered: May 2005
Posts: 378
Rep:
|
Quote:
The nice thing about rmdir is that it makes sure the directory is empty.
|
A pedantic point: "empty" directories actually contain two files, "." and "..".
|
|
|
08-07-2005, 08:19 AM
|
#6
|
Member
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269
Original Poster
Rep:
|
G,Day.: Thanks for all the tips they worked well . I also got to install a decent Editor that has better features than plain gedit. One more question that I really would like to know . What & how do I use the touch command,Sounds interesting
|
|
|
08-07-2005, 03:22 PM
|
#7
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 65
Rep:
|
Hey, >filename is a neat trick i never knew of.
Anyway, browser, just type 'touch filename' and it will create the file, if you want to know more about the touch, (or any command for that matter) type 'man command' as in 'man touch' and that will tell you about it.
As for a text editor I would suggest either EMACS or a vi derivative (I use Vim, but that's a matter of personal preference, and I know that many people prefer EMACS)
|
|
|
08-11-2005, 08:28 AM
|
#8
|
Member
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269
Original Poster
Rep:
|
Thanks Everyone , LinuxQuestions is the best Forum
|
|
|
08-11-2005, 08:28 AM
|
#9
|
Member
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269
Original Poster
Rep:
|
Thanks Everyone , LinuxQuestions is the best Forum
|
|
|
All times are GMT -5. The time now is 09:27 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|