LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-04-2013, 02:00 PM   #16
johnthsu
LQ Newbie
 
Registered: Oct 2013
Posts: 2

Rep: Reputation: Disabled
Remove tons of abc files


ll | grep abc | awk '{print "rm "$8" "}' | csh

Note:
"$8" -- column 8 of ll comand



Thanks
Sincerely
John Hsu
johnthsu@hotmail.com
 
Old 10-04-2013, 02:07 PM   #17
johnthsu
LQ Newbie
 
Registered: Oct 2013
Posts: 2

Rep: Reputation: Disabled
Remove tons of abc files

ll | grep abc | awk '{print "rm "$8" "}' | csh

Note:
"$8" -- column 8 of ll comand



Thanks
Sincerely
John Hsu
johnthsu@hotmail.com
 
Old 10-04-2013, 03:02 PM   #18
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Hi johnthsu, a couple of things

Firstly, the thread started in 2004

Second, ll is common alias ( alias ll="ls -l" ) and is not always available
also,
Code:
awk '/abc/{print "rm "$8" "}'
# is the same as
grep abc | awk '{print "rm "$8" "}'
# just 'cheaper' as less processes
and csh, not everone has csh

third, better way to do it ( in bash )

Code:
for i in "*";do
   mv "${i}" "${i#* }"
done
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/
http://www.tldp.org/LDP/abs/html/
http://mywiki.wooledge.org/BashGuide
http://www.gnu.org/software/bash/manual/bashref.html

http://www.tldp.org/LDP/abs/html/refcards.html#AEN22664
for "${i#* }"
 
  


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
Where do I get dependencies? Missing a ton Ryle Dup Linux - Software 5 08-11-2005 04:14 AM
remove characters in c alaios Programming 2 07-10-2005 11:10 AM
unable ton install mandrake 10.01 fr@n-6 Mandriva 5 03-20-2005 02:44 PM
NTFS - files with CE font characters not displayed? zocy Mandriva 1 02-08-2004 11:56 PM
international characters in linux preventing me from accessing files hypermegachi Linux - General 2 10-29-2003 06:34 PM


All times are GMT -5. The time now is 08:01 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration