Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Send directory in Long file
post Sep 27 2011, 09:07 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 27-September 11
Member No.: 15,598

How would I Send a directory in long format of the Lab3 directory to a file called dir.txt
Go to the top of the page
+Quote Post
post Sep 28 2011, 07:19 AM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,807
Joined: 23-January 03
Member No.: 360

At first glance is this homework?
What do you mean by long format?
Look at the options for the ls command
To send some sort of output to a file would be
ls > test.file (This will overwrite if the file exists)
ls >> test.file (This will append if the file exists)
Go to the top of the page
+Quote Post
post Feb 12 2014, 12:47 PM
Post #3

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 11-February 14
Member No.: 18,653

The command you are looking for is this:

ls -al >dir.txt

Make sure you inter the directory that you need to copy, in this case the Lab3 directory, then use the command prompt ls. This shows all the files and/or subdirectories in that directory(this is just to make sure there arent any unwanted files).

Once you are sure there are no unwanted files, use the command prompt:

ls -al >dir.txt

This will take the directory list(ls), and will take all files(including hidden ones) in long format and copy those into the destination file or directory, which in this case is dir.txt.

The greater than sign (>) before the dir.txt mean that it will overwrite anything located in that file/directory. If you were to use 2 greater than signs (>>) then it would add to what is already in the file/directory, putting it at the end of the file.

[if anybody notices anything wrong with this, please feel free to correct me. Im fairly new to Linux.]
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 21st July 2018 - 08:57 AM