Question

How would I go about answering these questions In linux. Please provide the correct linux command...

How would I go about answering these questions In linux. Please provide the correct linux command needed to answer these 4 questions

5. Display total words of each file under your root directory and subdirectories.

6. Change permission of every filename ends “.py” to — write read execute, group - read execute, other - execute

7. Find every line which contains “hello” from your file system, display both file name, line number.

8. Combine files with name “p3.py”, “p31.py”, “p32.py”, and redirect result to py.py

Homework Answers

Answer #1

ANSWERS: LINUX COMMANDS

5. DISPLAY TOTAL WORD OF EACH FILE UNDER YOU ROOT DIRECTORY AND SUBDIRECTORIES

# find . -type f -print | wc -l

6. change the permission of every filename ends ".py" to write read execute, group-read execute, other - execute.

chmod +wrx -.py ======> this command for write read and execute ".py" files

chmod g+rx ======> this command for read and execute in a group

chmod o+x ========> this command for execute in others.

w == write, r== read , x== execute, g==group, o==other.

7.find every line which contains "hello" from your file system. display both file name and line number

grep -R 'hello'

$ grep -n 'hello'

8.combine files with name "p3.py","p31.py" "p32.py"and redirect result "py.py"

cat p3.py p31.py p32.py >> py.py
 
Know the answer?
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
Similar Questions
In Linux please just type out command assuming files and directories are there Q21: display those...
In Linux please just type out command assuming files and directories are there Q21: display those line and line number do not contain “apple” from files whose name contains “file”. Q22: find all files, where file size is bigger than 100k and smaller 500k, and where filename ends with “.py” Q23: delete all directories with size larger than 10M or smaller than 1M. Q24: find out the five largest files or directories from current working directory, and output the result...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives the owner and group permission to execute the file avocado while giving the owner sole permission to read and write the file. Do not change any other permission, i.e., do not remove permission from others to execute the file, if they already have that permission. Q15 – File/directory permissions are subject to permissions on the parent directories. For example, consider the file /home/dv35/cs265/lab1.txt. If...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the codes below. Requirement: Goals for This Project:  Using class to model Abstract Data Type  OOP-Data Encapsulation You are asked to write an app to keep track of a relatively small music library. The app should load song information from a data file once the app is started. It should allow user to view, add, remove, and search for songs. The app should...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Suppose that people's heights (in centimeters) are normally distributed, with a mean of 170 and a...
    asked 3 minutes ago
  • Use the information from the following Income Statement to create and Projected Income Statement and solve...
    asked 16 minutes ago
  • An unequal tangent vertical curve has the following elements: g1=-3.25%, g2=75%, total length = 500.00’, length...
    asked 18 minutes ago
  • Please write clear definitions of the following legal terms. Commerce Clause Supremacy Clause Indictment Tort
    asked 22 minutes ago
  • Do you think Moralistic Therapeutic Deism is an accurate reflection of society today? What are relevant...
    asked 27 minutes ago
  • The mean operating cost of a 737 airplane is $2,071 per day. Suppose you take a...
    asked 36 minutes ago
  • Arguments can be made on both sides of this debate about the ethical implications of using...
    asked 42 minutes ago
  • In the Chapter, they mention the idea of strategizing around your cash flows. Why are cash...
    asked 47 minutes ago
  • Company A signed a fixed-price $6,500,000 contract to construct a building. At the end of Year...
    asked 48 minutes ago
  • An unequal tangent vertical curve has the following elements: g1=-3.25%, g2=1.75%, total length = 500.00’, length...
    asked 54 minutes ago
  • In a previous​ year, 61​% of females aged 15 and older lived alone. A sociologist tests...
    asked 1 hour ago
  • Topic: Construction - Subsurface Investigation (Note: Briefly discuss in your own words, 1 paragraph minimum.) Typically...
    asked 1 hour ago