Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Ubuntu 12.04. In my accounts .bashrc file I have the line

alias ftreport='cd / && sudo tree > /home/<user name here>/Documents/Reports/Tree_$(date +%s).txt'

After typing the command ftreport, I get

bash: /home/<user name here>/Documents/Reports/Tree_<epoc time here>.txt: No such file or directory

The command ftreport must output my system's file tree in my ~/Documents/Reports folder with the file title consisting of "File", an underscore, the epoch time, and ".txt". What is wrong and what should it be?

share|improve this question

Make sure that you change <user name here> to your username. And make sure that you can write in the ~/Documents/Reports folder.

share|improve this answer
alias tpsreport='cd / && mkdir -p /home/$(whoami)/Documents/Reports && sudo tree > /home/$(whoami)/Documents/Reports/TPS_$(date +%s).txt && cd -'

Seems to work...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.