Jump to content
Sign in to follow this  
JeroenM

Command line: write filenames to txt file

Recommended Posts

Hi,

 

I've got a directory with a lot of files.

How can I make a text file with the names of the content of that directory?

(It's easy but I forgot it)

 

Thanks

 

Jeroen

Share this post


Link to post
Share on other sites

ls -al > temp.txt

 

I think... I am not a command line guru like aru.. but I tried it and it works. At least, if I read your problem correctly. It's the > part that matters

Share this post


Link to post
Share on other sites

thanks.

I knew it was simple. But that it was that simple ;-)

(I knew I had to do something with the "output to a file" but not how)

thanks

 

Jeroen

Share this post


Link to post
Share on other sites

the > can be used to send output from any command to a file (or device sometimes)

 

my fav thing to do on the AIX server we used for programming up at school (we connected to it from win machines with X-Win32) was:

banner [some text] > pts/x

x being the pts that a friend of my was logged into at the time....we got in trouble for this when i taught others how to do it, and they started sending crap to the teachers terminal which was being projected onto a screen in the front of the class. i.e.: "PELUSO ROCKS!" (her name was Dr. Peluso, obviously)

 

thankfully, they never sent anything vulgar to her screen, nonetheless, they changed permissions on it so we could no longer use it :-(

 

just a little anecdote that this post reminded me off...:lol:

Share this post


Link to post
Share on other sites

try this on AIX ... (I've never got it working under linux :-( )

 

cat /dev/mouse > /dev/dsp

or

cat /dev/psaux > /dev/dsp

:-P

Share this post


Link to post
Share on other sites

don't have access to the AIX system anymore :( at a dif. school now.

Share this post


Link to post
Share on other sites
try this on AIX ... (I've never got it working under linux :-( )

 

cat /dev/mouse > /dev/dsp

or

cat /dev/psaux > /dev/dsp

:-P

What would happen?

Share this post


Link to post
Share on other sites

you would get a hell of a lot of noise coming out of your speakers, i would guess.

 

/dev/dsp is the digital sample and digital recording device (reference: http://www.guerrilla.net/reference/dsp/prog_dsp.htm)

 

you would be sending the mouse input out to the sound...so, most likely, moving your mouse (or maybe you wouldn't have to move it?) would create some sort of-most likely annoying-sound.

 

or would it get recorded? i'm not sure how > /dev/dsp would be translated by the dsp device....ok, aru, correct me :-) i confused myself...

Share this post


Link to post
Share on other sites

I'm not gonna try it tonight :lol:

 

but If it has to do anything I'm sure it should do what you've said

 

If you wish you can do harmless and 'pleasant' tests to your /dev/dsp with:

 

/dev/dsp < somefile.wav

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...