Results 1 to 2 of 2
I'm trying to understand redirection and clobbering within this:
[julius@station julius]$ touch file1
[julius@station julius]$ ls
file1
[julius@station julius]$ ls > file2
[julius@station julius]$ ls
file1 file2
[julius@station julius]$ cat ...
- 05-21-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 9
Noob question
I'm trying to understand redirection and clobbering within this:
[julius@station julius]$ touch file1
[julius@station julius]$ ls
file1
[julius@station julius]$ ls > file2
[julius@station julius]$ ls
file1 file2
[julius@station julius]$ cat file2
file1 file2
When the command "ls > file2" is used, I'm assuming:
This copies the contents of file1 in to file2, although file2 retains its name, while also preserving the original copy file1. Is this correct?
Also, I'm confused as how either file1 or file2 are showing following "cat file2".
Thanks,
Chris
- 05-21-2008 #2
Duplicate threads/posts are not allowed. Its against Forum Rules. Please continue here only.
Thread Locked.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First


