Delete only two files

Hello all I am new at this forum. I needed little help with unix

Display first two files on screen and at the same time send to recycle bin.

I tried following command and it deleted all files in my current directory.

ls -l | grep ^- | head -2 | rm *

let me know how do to this, is recycle bin means /dev/null ???

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If this is not homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Where did you get this assignment?

There is no recycle bin on a shell level. A recycle bin (sometimes call a trash bin or something else, depending on what window manager you use), is a window manager concept that can be used to dispose of things attached to icons on your desktop.

The rm utility physically removes files; it does not move them to a recycle bin.

/dev/null on UNIX systems is a special file that you can write data to that can never be retrieved, and, if you read from it, you will all get back an End-Of-File condition.

You need to be more precise:

  • Does "display files" mean file names and information on the file (such as owner or size), or file content?

  • When you say "first two", what kind of ordering do you imply on the files, and what is the set of files to be considered?

  • Why at the same time, and not after they have been displayd????