Which command can be used to rename a file or directory

Assignment Help Computer Engineering
Reference no: EM132154635

UNIX PROGRAMMING

Problem 8 (18 points): Answer the following questions regarding managing files and directories:

a) What does the command rm -r /trashbin/ accomplish?

b) What command flag can you use with cp so that it doesn't accidentally overwrite a file if it already exists (hint: look up the man page for cp)?

c) What command exists to delete a directory if and only if it is already empty?

d) Which command can be used to rename a file or directory?

e) Give the needed commands to accomplish the following scenario (use only 1 command for each one, and assume that each command affects the commands that follow it):

- Change to the directory /usr/share/

- Create two new directories called "oldcode" and "newcode" inside of this directory

- While still inside of /usr/share, create two new files, one called "main.java" inside of the "newcode" directory and another called "calculate.py" inside of the "oldcode" directory (use relative path/file names instead of absolute path/file names)

- While still inside of /usr/share, rename the "calculate.py" file inside of the "oldcode" directory to "calculate.backup" (use an absolute path/file name instead of a relative path/file name)

- Change to the directory "newcode"

- Set the permissions of the "main.java" file (using symbolic notation) so that the group has read and write permissions, but no execute permission

- Make a copy of the "main.java" file to the "oldcode" directory called "main.save" (use relative path/file names)

- Change to the parent directory /usr/share/ using ‘..' notation

- Delete all of the files inside of the "oldcode" directory, including the "oldcode" directory itself

- Inside of your current directory, remove the empty directory "tempcode" (assume it exists and contains no files)

Reference no: EM132154635

Questions Cloud

Complete the following table for different scheduling policy : In a uniprocessor system, five processes arrive at different time. The processing time for each process is listed in following Table.
Write a c program that allows a user to extract some part : Write a C program (partcopy) that allows a user to extract some part of an existing file (fileSource) and copy it to a new file fileTarget.
Write all scripts using the shell rather than learning a new : Why not just write all scripts using the shell rather than learning a new programming language like Perl?
Create a script that prints a friendly message : Create a script that prints a friendly message. However, the script can be executed only from one terminal.
Which command can be used to rename a file or directory : What command flag can you use with cp so that it doesn't accidentally overwrite a file if it already exists (hint: look up the man page for cp)?
What do you understand by network security threat : What do you understand by network security threat? What tools and Techniques are available to make the nwtwork more secure.
Propose the subnet address and subnet mask to be allocated : A university has been allocated the 192.1.0.0/16 address block. As the network administrator of the university, you have been asked to subnet the network.
What is your understanding of the issue : PSPGOV412A ASSESSMENT TASK - Audio Assignment - Workplace issue - What is your understanding of the issue. What are the options in relation to the issue
Identify some of the obvious actors of the above library : Identify some of the obvious actors of the above library system. Must identify at least three actors.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd