F5F Stay Refreshed Software Operating Systems Get assistance with the command line.

Get assistance with the command line.

Get assistance with the command line.

O
OrbaTheGamer
Junior Member
8
12-14-2025, 10:26 AM
#1
Hello, I understand you're working with CentOS. You want to count files and directories in another directory and format the output properly. Instead of just showing the date and count, you need to display the result in the specified format: "The number of files and directories in /etc on Thu Oct 16 17:18:16 PDT 2014 is 6162". Your current method captures the count but misses the formatting. You can use a command like `find /etc -type f | wc -l | awk '{ print $0, $NF }'` and redirect it to a file with the desired date.
O
OrbaTheGamer
12-14-2025, 10:26 AM #1

Hello, I understand you're working with CentOS. You want to count files and directories in another directory and format the output properly. Instead of just showing the date and count, you need to display the result in the specified format: "The number of files and directories in /etc on Thu Oct 16 17:18:16 PDT 2014 is 6162". Your current method captures the count but misses the formatting. You can use a command like `find /etc -type f | wc -l | awk '{ print $0, $NF }'` and redirect it to a file with the desired date.

E
elitemaster64
Member
142
12-15-2025, 09:57 AM
#2
Count the files and folders in /etc at this moment and display the result
E
elitemaster64
12-15-2025, 09:57 AM #2

Count the files and folders in /etc at this moment and display the result

A
alevy3131
Member
156
12-15-2025, 11:48 AM
#3
I am the divine being.
A
alevy3131
12-15-2025, 11:48 AM #3

I am the divine being.

A
Amber_Playzzz
Member
55
12-19-2025, 11:56 PM
#4
The number of files and directories in /etc on $(date) is $NUMBER
A
Amber_Playzzz
12-19-2025, 11:56 PM #4

The number of files and directories in /etc on $(date) is $NUMBER

T
TommyTheLommy
Posting Freak
846
12-21-2025, 09:09 AM
#5
You need to analyze the log file to count failed login attempts and format the result accordingly.
T
TommyTheLommy
12-21-2025, 09:09 AM #5

You need to analyze the log file to count failed login attempts and format the result accordingly.