LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 07-18-2012, 06:52 AM   #1
johnyhasan
LQ Newbie
 
Registered: Jun 2012
Posts: 9

Rep: Reputation: Disabled
Post 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.
 
Old 07-18-2012, 06:54 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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").
 
Old 07-18-2012, 06:54 AM   #3
rmugunthan
Member
 
Registered: Jan 2009
Location: Coimbatore, India
Distribution: rhel
Posts: 49

Rep: Reputation: 3
delete the file using "rm" command

rm test.txt --> to delete test.txt file in the current directory.
 
Old 07-18-2012, 07:07 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by johnyhasan View Post
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
 
Old 07-18-2012, 07:22 AM   #5
piyush.sharma
Member
 
Registered: Jul 2012
Location: Delhi, India
Distribution: CentOS
Posts: 82

Rep: Reputation: Disabled
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.
 
Old 07-18-2012, 08:17 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,244

Rep: Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create the file, write into that file but can't delete file in Linux pandunr Linux - Newbie 3 06-15-2011 08:45 AM
file from install ffmpeg conflicts w/file from package fmpeg-libs: which to delete? ybalazs Linux - Software 0 10-27-2009 01:21 AM
Upload file to ftp server -vsftp- but can not delete or change the file once uploaded murattas6 Linux - Server 2 06-26-2009 06:00 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration