ls


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ls
# 1  
Old 04-28-2004
ls

cd /abc/xyz
\ls -1l


what will be the output of the above command.Can anybody explain
# 2  
Old 04-28-2004
A single listing of all files in the directory xyz. Read the man page for ls. man ls That looks like a pipe on end of the second line, also the escape character "\" is out of place. Did you cut this out of a script that you are trying to understand?
# 3  
Old 04-28-2004
The escape character is valid, at least I know it is in Korn shell. It will remove any alias from the command before executing it.
# 4  
Old 04-30-2004
Re: ls

Quote:
Originally posted by meeran1978
cd /abc/xyz
\ls -1l
And that's not a pipe, it's a number 1.

From the man page for ls:
Code:
-l     use a long listing format
-1     list one file per line

So the OP intends to list all the details of each file and only one file per line.... seems redundant to me. By default, the long-listing format lists one file per line with all the details on the rest of the line.
# 5  
Old 04-30-2004
Yeah, understood the 1. Its the \ls -1l that I was questioning.
# 6  
Old 05-02-2004
google, what looks like a pipe is really the letter "L". I copied and pasted the line into notepad and it becomes obvious. It had me confused for a while.
# 7  
Old 05-02-2004
Gotcha! Well, there really isnt much point to using both -1 option and the -l option at teh same time as the output is the same as if you simply typed ls -l (at least it is on the HP machine I use).
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question