LinuxQuestions.org
Visit Jeremy's Blog.
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 04-23-2012, 09:41 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
can not remove file


When I use command rm to remove file , it pops the below error , can advise how can I remote the files ? thx

-bash: /bin/rm: Argument list too long
 
Old 04-23-2012, 09:45 PM   #2
derekpock
Member
 
Registered: Apr 2012
Location: USA
Distribution: Elementary OS Luna
Posts: 83

Rep: Reputation: 4
Hey,

Basically what this is saying that that when you typed in rm to remove a file, you entered too broad of an area. You need to make the command more defined, for instance:

rm /home/user/documents/file.odt

instead

rm /home
 
Old 04-23-2012, 09:55 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
It would be better to show the exact cmd you used, but derekpock is broadly correct.
Each cmd has a limit of how many params it can accept, you likely used a '*' in a dir with a lot(!) of files.
Try reducing the list by eg only files starting with 'a', then 'b' etc.
Really you need to look at the filenames and find a way of grouping them into shorter lists.
 
Old 04-24-2012, 02:29 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
For details on how to select files using globbing patterns, see here:

http://mywiki.wooledge.org/glob
 
  


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
[SOLVED] How do you find and remove largest file without having to manually type the file name am28 Linux - Newbie 4 11-23-2011 04:45 PM
File showing with ? when using ls -al. How to remove file with only ? tacdog Red Hat 1 09-18-2007 11:12 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 04:13 PM
How to remove this file? cqmyg5 Slackware 10 06-11-2006 01:38 AM
c++ file processing -- how to remove a record from a file sharonyiisl Programming 4 09-26-2004 04:54 AM

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

All times are GMT -5. The time now is 02:34 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