What Does Su > Echo "" Mean?

What Does Su > Echo "" Mean?

When I was entering the command

su > echo  "sachin"

it was asking for a password. When I gave my password, some strange things happened as you can see:

One more thing: there is another user, Hadoop, on my laptop, but when I do

su > echo "Hadoop"

it says

no passwd entry for Hadoop

What does this mean?

4

1 Answer

Ah! Nice puzzle!

Just say "exit", and all your files will be there (and the output you miss in a file called echo).

Explication:

 su > echo user 

is the same as

 su user > echo

So you are starting a (sub)shell with su (switch user) to your user, with all output redirected to a file called echo!

Look:

[romano:~] % cd tmp/dvd-usa-hd 
[romano:~/tmp/dvd-usa-hd] % ls
dvd-usa-hd_01_01.avi
[romano:~/tmp/dvd-usa-hd] % su > echo romano
Password: 
[romano:~/tmp/dvd-usa-hd] % ls
[romano:~/tmp/dvd-usa-hd] % exit
[romano:~/tmp/dvd-usa-hd] % ls
dvd-usa-hd_01_01.avi  echo
[romano:~/tmp/dvd-usa-hd] % cat echo
dvd-usa-hd_01_01.avi
echo
[romano:~/tmp/dvd-usa-hd] % 
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.