Help with a Linux problem question

  • Thread starter Thread starter aznlau22
  • Start date Start date
  • Tags Tags
    Linux
AI Thread Summary
To print the first 15 lines of all ".txt" files in a user's directories and subdirectories, the command "find $HOME -name '*.txt' -exec head -15 {} \;" is appropriate. This command utilizes the 'find' utility to locate all text files and then executes the 'head' command on each file found. The user is seeking clarification on the correct usage of these commands for their exam question. Proper understanding of command-line utilities is essential for effective file management in Linux. Mastering such commands can significantly enhance proficiency in navigating and manipulating files within the Linux environment.
aznlau22
Messages
1
Reaction score
0
This is my first time on this site so I'm not sure if I am even posting in the right section...
Well I had a exam last week on commands and utilities and I wasn't sure how to aswer one of the question. The question is how do you print the first 15 lines of all files ending by “.txt” in all your folders and subfolders?
i know i have to use the head command but where do i go from there?
 
Physics news on Phys.org
Code:
find $HOME -name '*.txt' -exec head -15 {} \;
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...

Similar threads

Replies
4
Views
1K
Replies
3
Views
1K
Replies
1
Views
3K
Replies
3
Views
2K
Replies
9
Views
3K
Replies
3
Views
3K
Replies
20
Views
3K
Back
Top