moving or removing a file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers moving or removing a file
# 1  
Old 12-31-2001
moving or removing a file

Hi,
Happy 2002.
Now I am actually encountering a problem.
Suppose I have a file which I can see has been named as -rw-rwx or .rwxrw-- .
when I try to move this file I am unable to do so.
Can someone please help me , How can i get rid of the file.

Thanks in advance .
Smilie
# 2  
Old 12-31-2001
Hi rooh,

Can you provide more information? What account are you using to remove the file? And not all the permissions of the file is given.

From part of the permissions shown, the owner and those who are a member of the group shall be able to remove the file. As they have the permission to read and write to the file, assume the permission to be -rw-rwx---.

For the other accounts, they are not given the right to remove the file.

Also root account shall be able remove the file, regardless of the permission.
# 3  
Old 01-01-2002
I think that rooh has a file whose filename is -rw-rwx. Since the filename starts with a dash, the shell will try to treat it as an option instead of a filename. You can override this default behaviour with:

ls -l -- -rw-rwx
rm -- -rw-rwx

The -- closes out option processing for the command so that the following info will be treated as filenames or whatever.
Jimbo
# 4  
Old 01-02-2002
You are right Jimbo . That's what I was really looking For.
Thanx alot. You knew exactly what I was looking for.
Have a nice time.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help! With File Moving

Hello, This is my first post, so please forgive my obvious lack of UNIX knowledge. I am trying/needing to write a script that follows this functional flow: 1. Access a config file that contains format:<directory> <filetype> <daterange> <directory> <filetype> <daterange> <directory>... (2 Replies)
Discussion started by: WildBeard83
2 Replies

2. UNIX for Advanced & Expert Users

Need help on moving .csv file from UNIX to windows file path

Need help on moving .csv file from unix to windows file path. (1 Reply)
Discussion started by: lakshmanraok117
1 Replies

3. Shell Programming and Scripting

File Renaming and Moving

Hello, I need some help with a script. I have a file that I need to move and rename into the new directory. I am pretty new to shell scripting and have been trying to us awk with out success. The file I will be getting is based in this format... (2 Replies)
Discussion started by: cburgoyne
2 Replies

4. Shell Programming and Scripting

moving file

Hello ALL, i hope everyone is fine here. I have found some directories that have 777 permission with below command. find ./ -type d -perm 0777 e/uploads/ e/uploads/s1 j/uploads/ j/uploads/s1 I want that if there is any php|html|css file found in above directory so move those... (4 Replies)
Discussion started by: learnbash
4 Replies

5. UNIX for Dummies Questions & Answers

File Moving Script

I want to make a script that moves all files with a keyword on it to another folder. and lets me know how many files it moved with that keyword. Im a total newbie with scripting so a little help would be much appreciated. (3 Replies)
Discussion started by: marchina
3 Replies

6. Shell Programming and Scripting

Need help in finding filesize , moving file , gzipping file

Hi , Please help with the following questions 1) how can i find size of a file ? i have written du -k $flname > s1 . Is this right ? Any other better suggeastions ? 2) how do I use mv command for moving the file ? I need the syntax with some examples 3) Command for printing the total... (1 Reply)
Discussion started by: Learning!
1 Replies

7. UNIX for Dummies Questions & Answers

moving logs automatically but not removing

hello all, Need assistance on the subject line above. I have a logserver.log located at /usr/local/logserver. It's NSLOGDEPTH=100. I'm not sure if this is the reason but my log file retention is only up to 100 only.. sample logserver001.log logserver002.log ... ... logserver100.log ... (2 Replies)
Discussion started by: lhareigh890
2 Replies

8. Shell Programming and Scripting

Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names

I'm trying to write a script that will look in an /exports folder for the oldest export file and move it to a /staging folder. "Oldest" in this case is actually determined by date information embedded in the file names themselves. Also, the script should only move a file from /exports to... (6 Replies)
Discussion started by: nikosey
6 Replies

9. Shell Programming and Scripting

Problem while moving a file

Dear Friends, You can easily understand my problem after looking into the code. test1.sh -------- #!/bin/sh LOG_HOME="/home/vel" while do echo `date` done test2.sh -------- #!/bin/sh LOG_HOME="/home/vel" if then sh $LOG_HOME/test1.sh >> $LOG_HOME/1.log (5 Replies)
Discussion started by: smvel
5 Replies

10. UNIX for Dummies Questions & Answers

moving a file?

i'm trying to move a file from one diectory to another and rename it at the same time. but its giving me an error . " mv: cannot unlink /dir2/file5 : No such file or directory" here is the command I'm using. mv /dir1/file1 /dir2/file5 solaris 8 (1 Reply)
Discussion started by: Holistic
1 Replies
Login or Register to Ask a Question