LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-19-2015, 09:06 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308

what about just: mv *.jpg ~/images/wallpapers/shared
that should work
I think you miss a very important point: * will be evaluated by the shell, before executing the command (whatever command is it), and therefore the shell will create the list you need.
ls, the command, will only format or sort the result (and grep is a filter)....
 
Old 01-19-2015, 09:29 AM   #17
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
Please do not use ls to pipe to commands!

It is not stable enough to be trusted. e.g., ls picture folder/ will output picture folder/ (two arguments, picture file & folder/)
I'm pretty sure globbing is what you're trying to do (as mentioned before) and will handle unusual filenames much better.
Remember, linux is case-sensitive.

* means any or all characters expanded - or everything (sometimes file/folders starting with . are not included)
*jpg means anything that ends with jpg - e.g. image.jpg
file_* means anything that starts with file_ - e.g. file_3002
file_*jpg means anything that starts with file_ and ends with jpg - e.g. file3002.jpg

A trick, */ will list all directories. (All directories end in / right? images/)

Try echo /* to see everything in your root directory.
 
  


Reply

Tags
ls



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] less command question sryzdn Linux - Newbie 8 02-15-2014 01:09 PM
DD command Question Anony999 Linux - Newbie 8 04-20-2012 09:47 AM
I have a question about the dd command! turtlemicro Linux - Newbie 1 11-05-2011 11:45 PM
Question about the dd command kaplan71 Linux - Software 5 04-09-2010 08:09 AM
Question about command dd miros84 Linux - Software 7 02-10-2010 04:09 PM

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

All times are GMT -5. The time now is 01:45 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
Open Source Consulting | Domain Registration