Find the answer to your Linux question:
Results 1 to 3 of 3
I need help with these questions. 1. Create a file in ~/scripts/ that lists all of the filenames in the folder /tmp that start with a n or b. The ...
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    1

    How to complete these questions, HELP!

    I need help with these questions.

    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. But one thing though i wonder, how do i go to another directory/folder if the cd <directory> doesnt work?

  2. #2
    Linux User
    Join Date
    Jun 2006
    Location
    Scotland
    Posts
    267
    Forum Rules: 3. no... homework questions...

  3. #3
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,095
    Quote Originally Posted by sveglio View Post
    I need help with these questions.
    Hello and welcome!

    As already pointed out, homework questions are not allowed, but if you'll start a fresh thread for each issue that you need help with and let us know what you've done to solve it yourself and where you are getting hung up, along with any error messages you are seeing, someone might be able to lend some guidance.

    Good luck to you with your course work!
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...