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.
|
 |
07-18-2012, 06:52 AM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 9
Rep: 
|
file delete
i can create a file that command is
touch test.txt
i want to run the file test.txt
and i want to delete the test.txt file
plz help me
Last edited by johnyhasan; 07-18-2012 at 06:55 AM.
|
|
|
07-18-2012, 06:54 AM
|
#2
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
The command "rm" is used to remove files.
Also, per the LQ rules, please avoid "SMS" speak and write words out in full (i.e. "please" instead of "plz").
|
|
|
07-18-2012, 06:54 AM
|
#3
|
Member
Registered: Jan 2009
Location: Coimbatore, India
Distribution: rhel
Posts: 49
Rep:
|
delete the file using "rm" command
rm test.txt --> to delete test.txt file in the current directory.
|
|
|
07-18-2012, 07:07 AM
|
#4
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
Quote:
Originally Posted by johnyhasan
i can create a file that command is
touch test.txt
i want to run the file test.txt
and i want to delete the test.txt file
plz help me
|
Homework?
To run (execute) a file, you need to set the permissions. "man chmod" for details
|
|
|
07-18-2012, 07:22 AM
|
#5
|
Member
Registered: Jul 2012
Location: Delhi, India
Distribution: CentOS
Posts: 82
Rep: 
|
to run the file you can use
chmod a+x file_name
it will give executable permissions to the file
and to delete the file you can use
rm -f file_name
but one question if you don't mind, what you want to run from a .txt file.
|
|
|
07-18-2012, 08:17 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,485
|
and also: touch test.txt will create an empty file, a file without content. What do you mean by "run" that file? What do you expect?
|
|
|
All times are GMT -5. The time now is 12:42 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
|
|