Question

1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having...

1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having to

type the long path name every time. Make your set up “permanent” for this quarter (the set up should last from one

login session to another).

2. Use echo to write a brief explanation of your set up in step 1.

3. If you are not at your home directory, go to your home directory and

don’t change directory

for the rest of this

module 1 lab. Then create a directory called

lab1-2dir

4. Stay in your home directory, create 3 empty files called

f1

,

f2,

and

f3

in the directory

lab1-2dir

5. Don’t use a text editor, add your user id to file

f1

and add the current calendar month to file

f2

. You should not have

to type in your user id or the current date and time, use the appropriate utility.

6. Use the correct option of the ls utility to show the size in bytes of file

f1

,

f2

and

f3

.

7. Use the set up you created in step 1, copy the file

lab1-2in

from the cis18b directory to your current directory. This

file has the name, high elevation, and low elevation of the biggest cities in the US.

For the next 3 steps, use only the filters that are reviewed in module 1 lecture notes. This means don’t use sed or awk,

there will be plenty of opportunities for sed or awk in the next lab assignment.

8. Show how many cities there are in the file

input

. Use a utility to count the cities, you should not have to count and

type it in yourself. The output should include a text explanation, such as:

Number of big cities: 50

9. Show the city name with the lowest low elevation (show city name only).

10. Show the city name and the high elevation of all cities with a high elevation of 2000 ft or more. The output should

only be the city name and the high elevation, separated by a dash.

[Hint: use a regular expression to look for elevations greater than or equal to 2000, the regex should describe the

elevation as 4 characters]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.
echo "export CIS18B=~/cnguyen/cis18b" >> ~/.bashrc
echo "cp -rf CIS18B/* ~/voyager" >> ~/.bashrc
source ~/.bashrc
-----------------------------
2.first command will store cp command to ~/bashrc.
source ~/.bashrc will execute .bashrc file.
so that cp command will store in ~/.bashrc file.
so that when you open terminal by default all file will copy to voyager.

3.cd ~/ : go into home directory

4. mkdir lab1-2dir
touch lab1-2dir/f1 lab1-2dir/f2 lab1-2dir/f3 : create files in lab1-2dir

5. cal > lab1-2dir/f1 : print calander into f1
echo "1234 `date`" > lab1-2dir/f2 : print id and date into f2

6. ls -l lab1-2dir/f* : print file details you cab find the size in bytes in 5th column.
7. cp CIS18B/lab1-2in ~/lab1-2dir : copy file from ~/cnguyen/cis18b/ to ~/lab1-2dir
8. No Idea what you learn in class about which type of filter you used.Still according to HomeworkLib rule. I should give upto 4 points anser but i gate 7.
  

Add a comment
Know the answer?
Add Answer to:
1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory Select the correct find command string below that will accomplish this. find /etc-name 'resolv.conf -cat D find /etc-name 'resolv.conf -exec cat 0 find. -name 'resolv.conf -exec cat 0\ find /-name 'resolv.conf' -exec cat 0 QUESTION 2 What find command...

  • 1. Navigate to your home directory by typing cd. Now type ls and notice that there...

    1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here, which single command would you use to navigate directly to the Downloads folder that is located in your home directory? The output of the command would be as follows: 2. From the Downloads directory which single command would you use to navigate back up...

  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

  • Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume...

    Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume you are started at your home directory. Perform a command that displays the absolute path of your home directory (your current location). Create a new directory inside your home directory and name it “Assignment-3” Without moving into the directory you just made (staying in your home directory), create two new directories using one command inside of the Assignment-3 directory, and name them Test1 and...

  • do numbers 4-8 4. Given any directory, use the Is command to display: • all files...

    do numbers 4-8 4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...

  • 1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting...

    1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting output to /dev/null. Be sure you copy and run bother10.sh, NOT bother.sh. 2) Run a command that shows the job number of the process running bother10.sh. 3) Run a command that shows the process ID of the process running bother10.sh. 4) Copy the script make_foo.sh from ~ghoffman/course_files/it244_files to your current directory. Run this script. Using touch, create the file foo.txt. Perform a long listing...

  • Step 3: How would you write this script in C? It needs to do the things...

    Step 3: How would you write this script in C? It needs to do the things required in step 3. 1. You have received a new batch of distinguished users; their basic information is located in newusers.tar. Inside of the tar file, there is a file called "newusers.txt" which contains a colon-separated entry for each user: the username, the uid, the GECOS information, and the user's preferred shell. Also in the tar file you will find a public key for...

  • Unix/Linux The purpose of this lab is to practice the commands to manage and organize files...

    Unix/Linux The purpose of this lab is to practice the commands to manage and organize files and directories: How would one go about this? Thanks. Task 1: Preliminaries: 1) If you have not already done so, create a directory called bin under your HOME directory. 2) If you have not already made a copy (using ftp) of the file called famous.dat from the Assignment#1, do that now. 3) Make bin the active/working directory. Task 2: Perform all of the following...

  • LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check...

    LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check the output) Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs). Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT