getting Output of ls command in a file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers getting Output of ls command in a file
# 15  
Old 08-25-2010
Odd!

Can you run these commands?:

Code:
ls -lLad .
ls -lLad /tmp
ls -lL list.txt

(no idea what I'm hoping to stumble on, but you never know Smilie)
# 16  
Old 08-25-2010
And

Code:
pwd

Might be that the original directory is /tmp ?
# 17  
Old 08-25-2010
Quote:
Originally Posted by methyl
And

Code:
pwd

Might be that the original directory is /tmp ?
Hadn't considered that Smilie And I guess different OS' have different ways of telling us simple things with stupid error messages!

But OSX does't complain:
Code:
/Users/scott/scripts/tmp/tmp20 $ cd /tmp
/tmp $ touch x 
/tmp $ ll x
-rw-r--r--  1 scott  wheel  0 25 Aug 20:15 x
/tmp $ mv x x
/tmp $ ll -lLd .
drwxrwxrwt  17 root  wheel  578 25 Aug 20:15 .
/tmp $

And AIX gives a sensible message:

Code:
/tmp $ touch y
/tmp $ mv y y
mv: 0653-405 y and y are identical.
/tmp $

# 18  
Old 08-25-2010
Quote:
Originally Posted by scottn
Odd!

Can you run these commands?:

Code:
ls -lLad .
ls -lLad /tmp
ls -lL list.txt

(no idea what I'm hoping to stumble on, but you never know Smilie)



Code:
boyce-162-119:Tst jdhahbi$ ls -lLad .
drwxr-xr-x  7 jdhahbi  staff  238 Aug 25 11:30 .
boyce-162-119:Tst jdhahbi$ ls -lLad /tmp
drwxrwxrwt@ 18 root  wheel  612 Aug 25 11:30 /tmp
boyce-162-119:Tst jdhahbi$ ls -lL list.txt
-rw-r--r--  1 jdhahbi  staff  24 Aug 25 11:30 list.txt


Last edited by Scott; 08-25-2010 at 03:34 PM.. Reason: Added code tags
# 19  
Old 08-25-2010
Quote:
Originally Posted by jdhahbi
Code:
boyce-162-119:Tst jdhahbi$ ls -lLad .
drwxr-xr-x  7 jdhahbi  staff  238 Aug 25 11:30 .
boyce-162-119:Tst jdhahbi$ ls -lLad /tmp
drwxrwxrwt@ 18 root  wheel  612 Aug 25 11:30 /tmp
boyce-162-119:Tst jdhahbi$ ls -lL list.txt
-rw-r--r--  1 jdhahbi  staff  24 Aug 25 11:30 list.txt

I'll google the error, but in the interim will classify it as an ACL "issue" Smilie
# 20  
Old 08-25-2010
Just in case:

Code:
$ touch file1 file2 file3 file4
$ printf '%s\n' *|paste -sd,>list
$ cat list 
file1,file2,file3,file4

# 21  
Old 08-25-2010
Hi radoulov
##
$ls
file1 file2 file3 file4
##
$printf '%s\n' *|paste -sd,>list
usage: paste [-s] [-d delimiters] file ...
##
$ ls
file1 file2 file3 file4 list
##
$cat list
$
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command output redirection to file issues

Hi, I have a peculiar issue w.r.t redirecting the command output to a file when using loop. I am redirecting command output to same file in a series of if condition statements, but if one block of if condition statement writes the log to the file , the subsequent block of if condition... (7 Replies)
Discussion started by: ananan
7 Replies

2. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

3. Shell Programming and Scripting

Treat Command Output as a File

Hi. Before I've post this question, I have spent hours looking for the solutions but to no avail. Because I think it is possible but I just don't know what is the right keyword to search for. Ok, basically what I want to achieve is really simple. It's just that I don't want to write... (20 Replies)
Discussion started by: aimy
20 Replies

4. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

5. UNIX for Dummies Questions & Answers

taking the output of awk command to a new file

cat doc | nawk -v da="${date}" '$23>199 {print $0 > "doc"+da+".txt"}' Every time(need to run every day) i run this, i want to a create a new file "doc_01 Aug.txt". Basically, i want to create a new file with date appended in it. The above command is creating a file with name "0".... (4 Replies)
Discussion started by: vagar11
4 Replies

6. Shell Programming and Scripting

to take the output of a command to a file

hi , i am using iostat -nmzx 1 | awk '{ print $4 }' command to get the i/o rates of disks. but i want command output in a file , how can i capture , this is some what difficult because command output is keep on changing , any way i have to get total output of the command . please help me .... (1 Reply)
Discussion started by: shankr3
1 Replies

7. Shell Programming and Scripting

Help me to command to output file format.

Dear Master. Help me to command to out put. Ex log. "<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom> <txid>17251032659</txid> <authentication> <user>admin</user> <password>Amrduoi</password> </authentication> <destination> <msisdn>1111111</msisdn> ... (2 Replies)
Discussion started by: ooilinlove
2 Replies

8. Shell Programming and Scripting

Redirecting output of a command to a file

Hi We are having a requirement where one shell script, say a.sh (which uses Java and connects to Oracle database using JDBC) keeps on running everytime. I created a wrapper (to check whether a.sh is running and if not then to start it) and scheduled it in the crontab. Now all the output from... (3 Replies)
Discussion started by: ankitgoel
3 Replies

9. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

10. UNIX for Dummies Questions & Answers

Output of command to 2 separate file?

How would I echo the same results to two files? One is a running log, and the other is a cache, or sort. echo "Hello World" >> /Logs/File1 & /tmp/file2 I would just copy it from one place to the other, but the Log keeps history, where I want the /tmp to hold only stuff per session. I tried... (2 Replies)
Discussion started by: TheCrunge
2 Replies
Login or Register to Ask a Question