01-15-2012
1,
0
Join Date: Jan 2012
Last Activity: 15 January 2012, 8:34 AM EST
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
Need help with some questions i got on a test!
I had a test 2 weeks ago, and i got these questions that i really need help with. I cant remember exactly how they were, but i will write as much as i can and i hope you guys understand.
1. Create a file in ~/scripts/ that lists all of the filenames in the
folder /tmp that start with a n or b. The file you create should be named list.txt
First of all, how do i get to ~/scripts/? And why cant i go to /tmp by typing cd /tmp, it says something like no such directory exists?
2. Rename the file Merry&Christmas to Merry Christmas
in the home directory of the user, there was a file named Merry&Christmas, so i just had to rename it to Merry Christmas, so i wrote = mv Merry&Christmas Merry Christmas. It didnt work, why?
3. Create a new user hum with password hum.
In the home directory of the user hum, create a file named fil_1.txt owned by user hum?
4. Create a bash script called script1 in the home directory. This script should verify that the first command line argument is a name of an existing directory. If it is not, the script should exit with an error message. Otherwise, it should start the command “tar -czf /tmp/bak.tgz X”, where X is that directory.
What?
5. Run the script script1 as a background task, giving “/usr” as an argument. After the script is done, make sure it worked!
I hope you guys can help me with this, there is more questions i didnt know but i cant really remember them (DAMN!) I will edit if i remember them later on. But one thing though i wonder, how do i go to another directory/folder if the cd <directory> doesnt work? Its weird, at home, i manage to complete almost all practice questions. At test, these commands doesnt work : /