Ok what I want to do is list folder contents in the terminal so that I can cope the file names into a text doc, how do I do this?
thanks
contra im looking in your direction ![]()
Ok what I want to do is list folder contents in the terminal so that I can cope the file names into a text doc, how do I do this?
thanks
contra im looking in your direction ![]()
You can also do
ls > filelist.txt OR
ls -l > filelist.txt
to automatically output the list to a text file.
Andrew179 gave the right advice. Be warned though, using ">" will overwrite any text that is already in the file, so use ">>" if you want to append to an existing file.
k im obviously a teminal idiot, so i do ls-l, then i see the folder that i want to list the files, then what>?
ls lists the directory that you're currently in, so if you are in the directory with the files you want to list, then just do:
ls -l > filelist.txt
or if you are not in the directory, type
cd *directorynamehere*
ls -l > filelist.txt
ahhhhhh, i gotcha Thanks sooooo much, you just made my life so much easier
ok, im still having some issues with this. Let me see if I can explain this a little better. On my desktop i have a folder, in that folder is another folder, and inside that folder is three other folders.
When I do a cd, I can go cd desktop, cd work (the folder on the dtop) cd kjell (folder inside that folder) and thats as far as i can go.
any ideas
Originally posted by Photo678@Mar 6 2004, 02:26 PMok, im still having some issues with this. Let me see if I can explain this a little better. On my desktop i have a folder, in that folder is another folder, and inside that folder is three other folders.
When I do a cd, I can go cd desktop, cd work (the folder on the dtop) cd kjell (folder inside that folder) and thats as far as i can go.
any ideas
What is the output of "ls -a" in that last folder, can you see the folders?
That's really odd.
Yeah, i can see the folders in the list, just can change the directory to them, or do is there a way to list the contents of that each folder.
There are a bunch of parameters for ls but for just simple usage try ls -l , ls -a, and ls -m or just ls. It all depends on what type of information is shown, like
ls (will show non hidden files in alphabetical order)
ls -l (will show permissions)
ls -a (will show hidden files)
ls -m (will display names in a single line, with commas separating names)
If you just wanna quickly view the text file in the terminal just cat it
cat textfile.txt